docs(build): document APS5_TRACE_DRAW_PROGRAMS

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Adrià FranchandClaude committed 2026-10-14 23:39:27 +02:00
1 parent fffa0f3865
commit de0cd00eb1
1 file changed
+2
+2
View File
@@ -161,6 +161,8 @@ The `gpu` track holds one `batch` slice per recorder batch, from the batch's tim
With any of the three switches set, the recorder writes a timestamp pair per batch for the whole run, as with `APS5_PROFILE_DRAW`. Without them, a `PerformanceTimer`, a GPU mutex acquisition and a read of batch timestamps each cost one more predictable branch.
Set `APS5_TRACE_DRAW_PROGRAMS=1` (any value) to print one `[draw-programs]` line on stderr per draw, with the submission serial, the queue, and for each selected program its stage and role, the shader's code address and its entry address (`vertex/main=0x100000(entry=0x100040)`). It is for comparing the shaders a draw selects with shader-preparation failure logs; it reads no GPU state.
### Summaries for a long session
Set `APS5_TRACE_SUMMARY_EVERY=<seconds>` (a whole number above 0; a malformed value fails the first present) to profile a long session in the background without a trace. The first present opens the first interval. Every `<seconds>` seconds, at the first present at least that long after the interval opened, the presenter appends one line to `aps5-summary.jsonl` in `APS5_TRACE_DIR` or the working directory and opens the next interval at that same present, so the intervals follow each other without a gap and their `frame_ms` cover every interval between presents. The line has the fields of the window summary line for that interval only, plus `interval_start_s` and `interval_end_s` (seconds since the first present). Its `window` is `{"spec":"summary_every <seconds>","first_present":<present the interval opened at>,"ms":<span of the interval's presents>}` and its `trace` is the empty string. No event buffer is allocated: each thread keeps only the per-scope totals it already folds (a few kilobytes), and the presenter subtracts the totals of the previous interval. An interval that is still open when the title exits writes nothing.