Skip to content

l_frame_check: byte identity on raw defined bytes, per-run sentinels, missing outputs fail - #165

Merged
phantoslayer21 merged 1 commit into
mainfrom
model-l/framecheck-raw
Nov 14, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
model-l/framecheck-raw

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

The fix for finding 1 of the #162 review: clean/l/runner/l_frame_check.py's "byte for byte" comparisons now compare raw defined bytes, with sentinels.
Before, they did not prove byte identity:

  • They compared decoded values: pipeline.py's decode drops the reduced history's bits 30-31 and the history's 4th
    FP16.
  • An output that was all zero on D3D12 counted as "not written", and the frame still counted as identical.
  • They used no sentinels.

What changes

  • clean/l/runner/l_frame_check.py
    • Every output (RAW_OUTPUTS, 28) is recorded as its raw defined bytes: the sizes wg_rt_buffer reports; the
      pack12 images at their own sizes; the display image without its row padding, which no kernel writes. These are
      compared byte for byte (raw_compare) in all three comparisons: HIP default against the six-launch bottleneck,
      D3D12 against HIP, and D3D12 default against the run with the fusions off.
    • Before every frame, each run fills the outputs with its own sentinel: HIP stages 0xC3, HIP default 0xA5, D3D12
      stages 0x3C, D3D12 default 0x5A. The buffers the next frame reads before it writes them are left alone: the reduced
      history, the exposure pair, and the last frame's history, latent and motion surface.
    • A missing output, an output of another size, or any differing byte fails the frame.
    • Outputs a configuration does not write by design are listed per comparison with the reason, and every byte there
      must still hold that run's sentinel. They are: b0 ... b4 under the bottleneck megakernel; enc1's merged map under
      fusion pm; Model M's dec2 / dec1 maps, which its fused decoder reads on chip; the display image of the fused pack12
      post; and on the first frame, the previous frame's state.
    • Model M's pack12 images are rearranged into the base layout's bytes for the comparison with HIP's base-format run.
    • Negative controls, at record level, on every comparison; each must fail the comparison:
      • one history write dropped (the 4th FP16 of one pixel back to the sentinel);
      • one reduced write (bits 30-31 of one word);
      • a whole reduced write (the last frame's words stay);
      • an output missing.
  • clean/runtime/runtime.cpp, wg_runtime.h: wg_rt_fill, a diagnostics call that sets a named buffer's allocation
    to a byte; it also works before the first frame. The runtime keeps each allocation's size for it.
  • clean/runner/pipeline.py: Pipeline.fill, Pipeline.raw.

Refs #89

Re-run on main (9a42f4b; synthetic models, l_frame_check.py --run HIP, D3D12, D3D12 stages, then --compare and
--compare-d3d12; records records/framecheck-raw-hip.json and records/framecheck-raw-d3d12.json in the rr-plugin
build folder)

  • HIP default against the six-launch bottleneck, raw bytes: Model L 11 of 11 frames identical (28 outputs), Model M 11
    of 11. All negative controls caught.
  • Model M, D3D12 against HIP, raw bytes (pack12 images in the base layout): 11 of 11 identical (28 outputs). All
    negative controls caught.
  • Model L, D3D12 default against the fusions-off run, raw bytes: 11 of 11. All negative controls caught.
    • Every stage of that run against the reference: 11 of 11; its post against Model M's post reference: 11 of 11.
  • Both checks pass.
  • The one new difference the raw comparison found was the display image's row padding (7,776 bytes a frame, kept by
    both runs' sentinels: written by no kernel). The image's own bytes are identical; the padding is now outside the
    defined bytes.
  • Model L with its own post (l_post=own, Model L's own reconstruction on the D3D12 frame (runtime option l_post=own) #162), on a local merge of Model L's own reconstruction on the D3D12 frame (runtime option l_post=own) #162's branch with this one (record
    records/framecheck-raw-l-own-post.json):
    • D3D12 against HIP's default run, raw bytes, post outputs included: 11 of 11 identical.
    • Default against fusions off: 11 of 11.
    • All negative controls caught.

Note for #162: compare_backends now returns raw results, without unwritten_d3d12.
l_d3d12_own_post_check.py needs fill_sentinels / raw_outputs in its run, and raw_compare / negative_controls
in its compare (the run above did exactly that).

Tested

  • The re-runs above; clean/l/runtime/tests/test_l_runtime_frame.py (18 tests); public gates.

Not tested

  • The record-level negative controls edit a recorded run; no GPU run with a kernel store actually removed.

… missing outputs fail

The frame check's "byte for byte" comparisons (HIP default against the six-launch
bottleneck, D3D12 against HIP, D3D12 default against the run with the fusions off)
compared decoded values (the reduced history's bits 30-31 and the history's 4th FP16
dropped), skipped an output that was all zero on D3D12 as "not written" and used no
sentinels (review of #162, finding 1).

- Every output (RAW_OUTPUTS) is recorded as its raw defined bytes (the sizes wg_rt_buffer
  reports; the pack12 images at their own sizes; the display image without its row
  padding, which no kernel writes) and compared byte for byte (raw_compare).
- Before every frame each run fills the outputs with its own sentinel (HIP stages 0xC3,
  HIP default 0xA5, D3D12 stages 0x3C, D3D12 default 0x5A), except the buffers the next
  frame reads before writing them. A missing output, one of another size or any
  differing byte fails the frame; outputs a configuration does not write by design are
  listed per comparison with the reason, and must still hold that run's sentinel.
- Record-level negative controls on every comparison: one history write (the 4th FP16
  of one pixel), one reduced write (bits 30-31 of one word), a whole reduced write
  dropped, an output missing; each must fail the comparison.
- Model M's pack12 images are rearranged into the base layout's bytes for the comparison
  with HIP's base-format run.
- runtime: wg_rt_fill (diagnostics: a named buffer's allocation set to a byte, also
  before the first frame); pipeline.py: Pipeline.fill and Pipeline.raw.

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 12:02
@phantoslayer21
phantoslayer21 merged commit dc80ba5 into main Nov 14, 2026
9 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/framecheck-raw branch November 14, 2026 13:15
phantoslayer21 added a commit that referenced this pull request Nov 14, 2026
…nels, raw defined bytes, negative controls

Each run fills its outputs with its own sentinel before every frame and records every output's raw defined bytes; both raw comparisons (against HIP, defaults against stages) fail on a missing output, another size or any differing byte, and carry l_frame_check's record-level negative controls.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
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