Skip to content

Runtime frame trace: launch arguments, allocations, sizes, resets, an injected failure - #119

Merged
phantoslayer21 merged 6 commits into
mainfrom
model-l/frame-recorder
Nov 14, 2026
Merged

phantoslayer21 merged 6 commits into
mainfrom
model-l/frame-recorder

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

The CPU frame trace (#108) now records what each launch is given, not only which kernel runs. This is the recorder the
review of #111 asks for (buffers, argument values, extents, reset, parity, failure, changing sizes), and the acceptance
list for the Model L frame on HIP and on D3D12 builds on it. Nothing changes in the runtime.

What changes (clean/tests/)

  • runtime_frame_trace.cpp:
    • each allocation is logged (alloc b<k> <bytes>);
    • for the kernels in its table, the recorder decodes each launch's arguments: device addresses as b<k>+<offset>
      (or 0), ints, and the encoder / decoder parameters as E{rw,rh,fw,fh,frame,reset} / D{rw,rh,fw,fh,reset}. The
      table covers Model M's input_encoder, coef_decoder and Swin blocks, and Model L's kernels as
      clean/l/FORMATS.md gives them;
    • each frame prints its wg_rt_info (index, parity, effective reset, render size);
    • flags: --sizes= (render size per frame), --reset= (the game's reset), --fail=<kernel>@<frame> (that launch
      fails), --format= / --map= (model.wgcm with its map);
    • a failed frame prints what ran up to the failure and the error; the next frame then runs.
    • dec1's block fused with the decoder (swin_block_c64_add_dec0*) has its own entry: x, skip, w, H, W, ox, oy.
      A first version read it with the blocks' common form; that showed up as unknown addresses that changed from run
      to run. The tests now assert that no decoded argument is an unknown address (the shipping build runs the fused
      block).
  • test_runtime_frame_trace.py: a Trace parser keeps the arguments (parse() still returns the old shape). New
    checks for Model M:
    • dataflow: the encoder's features are enc1's input, and dec1's output is the decoder's input (same allocation). Each
      buffer is large enough for its map. dec1's H, W are the F/2 grid. The parameters carry the render size and the
      padded grid. Two sizes: aligned 64 x 64 and non-aligned 80 x 48;
    • history: the latent the decoder writes and the near motion the encoder writes are what the next frame's encoder
      reads (the two buffers swap);
    • reset and parity: six frames with the size changing 96 x 96 -> 80 x 48 -> 64 x 64 and a game reset at frame 2.
      The effective reset is 1, 0, 1, 1, 0, 1 (first frame, the game's reset, two size changes) and reaches the
      encoder's and decoder's parameters. The parity alternates. The size and grid are right in every frame;
    • failure: an injected failure of the decoder in frame 1 stops that frame right after dec1 (nothing after it). The
      error is reported, and frame 2 runs whole.

Refs #89

Tested

Not tested

… an injected failure

The recording device decodes the arguments of the encoder, decoder and block kernels (and Model L's, per clean/l/FORMATS.md): device addresses as allocation + offset, ints, the encoder / decoder parameters. Flags for per-frame render sizes, game resets, a failing launch, the model format and map. New checks for Model M: dataflow encoder -> enc1 and dec1 -> decoder, buffer extents, the history between frames, reset and parity, changing sizes, a failed launch stopping its frame. Nothing changes in the runtime.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…nknown address in a decoded argument

swin_block_c64_add_dec0* takes x, skip, w, H, W, ox, oy (not the blocks' common form): the generic entry read an int as an address. The tests now assert that no decoded argument is an unknown address (the shipping build runs the fused block).

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 14, 2026 01:37
@phantoslayer21
phantoslayer21 merged commit 382ac79 into main Nov 14, 2026
9 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/frame-recorder branch November 14, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant