Skip to content

Model L frame check on real weights: --model for the converter's model.wgcm; record - #133

Merged
phantoslayer21 merged 3 commits into
mainfrom
model-l/real-weights-frame
Nov 14, 2026
Merged

phantoslayer21 merged 3 commits into
mainfrom
model-l/real-weights-frame

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Model L's HIP frame (#111) on real weights: clean/l/runner/l_frame_check.py --prepare --model <model.wgcm> runs
the frame check with the converter's Model L file in place of the synthetic model. The runtime loads it through
l::load_wgcm_model and checks it against the map (default: the shipped data/preset-L.v1.map.json); the CPU
reference gets the values the file holds. Frames stay synthetic. The model file stays in the build folder and is
never part of the repository; only its digest is recorded.

The summary now also gives, per stage, the largest difference, the non-finite values on each side and the largest
finite magnitude on each side (saturation would show as one side stopping where the other goes on).

What changes

  • clean/l/runner/l_frame_check.py: --model / --map (with --prepare only; refused otherwise), a
    source.json beside the model (synthetic seed, or the file's and map's SHA-256), carried into the JSON;
    got_absmax / ref_absmax / ref_nonfinite in the FP8 and FP16 metrics; max_diff, nonfinite,
    ref_nonfinite and the magnitudes in the per-stage summary. The pass rules are unchanged.

Record

The model: WrongGPU.exe model convert --preset=L --model=<the game's upscaler DLL> --noscan, the launcher built from
main dbdfaff. As the launcher reports it: file version 310.9.1.0, DLL SHA-256
3975567b8943c53acce397f2b72380092f84f162d00b0d2c7d08a1025c563983; map SHA-256 58e6d0e7…e857 (preset-L v1.1);
"all 15 stage digests match"; model.wgcm SHA-256 d3c040191ec7ab0164efc03ee76413277e7fb54e6e6d2b168f2c0202aa1ad806.

The run: this branch (main dbdfaff + this commit), Model M's code objects from clean.runner.build --no-runtime --no-model-k, then --prepare (synthetic) and --prepare --model (real) in two build folders; --run in a locked
GPU slot (gpu_slot.py --cap-s 170, 2.0 s each, no wait), --compare on the CPU. Re-run on the merged head 262482c (main 26eb21e with #131, #132, #134 + this commit), same GPU-slot procedure (2.0 s): every per-stage summary identical to the first run, same single failure. Same 11 frames as #111 (96 x 64
x 5, 80 x 48 x 3, 77 x 45 x 3; resets on frames 0, 2, 5, 8, 9; both parities). Post kernel post_recon2_r_band.

Result: real-weight Model L fails its post rule on 1 of 11 frames (frame 6, 80 x 48, not a reset). Every other
stage passes on all 11 frames; frame state, exposure (11 / 11 identical) and default-kernels-vs-six-launch (11 / 11
byte-identical) pass. The synthetic Model L and the Model M control pass everything, as in #111.

Values differing / values compared (largest difference: FP8 steps under the per-stage rule, FP16 ulps, or codes):

output (rule) L synthetic L real weights M control
enc0 features (per-stage rule) 2108 / 1081344 (18) 850 / 1081344 (75) 62 / 1081344 (5)
enc0 m_near / m_far / m_center (1 ulp, 99.5 % exact) 5, 8, 5 / 105270 (1) 5, 8, 5 / 105270 (1) 5, 8, 5 / 105270 (1)
enc1 skip / merged 26 (24), 47 (13) 54 (18), 72 (12) 364 (39), 247 (41)
enc2 skip / merged 16 (1), 41 (13) 49 (7), 45 (27) 12 (7), 39 (16)
b0 ... b5 (135168 each) 0, 0, 0, 0, 1, 0 (1) 0, 0, 9, 0, 13, 0 (1) 3, 0, 0, 7, 0, 157 (12)
dec2 / dec1 71 (11), 16 (3) 3 (2), 143 (37) 0, 130 (10)
dec0 A / B / latent codes (99.5 % identical) 4 (1), 0, 0 6 (2), 5 (11), 10 (5) 0, 0, 0
dec0 C values (99.5 % identical) 9 / 157905 (10) 31 / 157905 (313) 1 / 157905 (1)
post history / display (FP16 acceptance) 396, 397 / 641520 (13) 597, 565 / 641520 (79, 86) 520, 488 / 641520 (4)
post reduced codes (within 1, 99 % exact) 8 / 160380 (1) 17 / 160380 (6), fails on frame 6 13 / 160380 (1)
filter (rtol 1e-5) 0 / 285120 0 / 285120 0 / 285120

Real-weight findings, plainly:

  • Post, frame 6: one output pixel (history row 105, column 174 of 180 x 108; near the bottom-right edge of the
    80 x 48 render) is 12 / 79 / 78 FP16 ulps off in its three channels, and the reduced history there is 6 and 3 codes
    off. The rule allows 1 code, so the frame fails. History and display themselves pass the FP16 acceptance on that
    frame (5.1e-5 of values over 1 ulp; rule 1e-4). Post runs on the runtime's own A, B, C, so the difference is inside
    the post kernel against clean/reference/post.py at that pixel, not in the decoder.
  • Decoder C range: the real weights drive C to -20.8 ... 64.0 (99.9th percentile of |C| 58.2); the synthetic
    model stays within +-7.57. The synthetic check never exercised this range. C reaches 64.0 exactly in both the
    runtime and the reference (C differs in only 31 values). Largest C difference 313 FP16 ulps (frame 8, 6 values);
    within the 99.5 % rule.
  • Largest differences grow with real weights in enc0 (75 FP8 steps, against 18 synthetic), enc2 merged (27) and
    dec1 (37); all within the per-stage rule (worst enc0 frame: 0.11 % of values more than one step off; rule 2 %).
  • No NaN, no overflow: 0 non-finite values in the GPU outputs and in the reference, every stage. Magnitudes match
    on both sides in every stage (no clipping on one side); the bottleneck reaches 256 (b4) against 18 synthetic.

Nothing was tuned; the rules are #111's.

Tested

  • Real converted Model L, HIP, locked GPU slot: frame check as above (fails post on frame 6; the finding).
  • Synthetic Model L and the Model M control on this branch: pass every stage on all 11 frames (re-check of Model L runtime frame on the HIP backend (confirmed FORMATS.md interface) #111 on
    current main).
  • py_compile of the script; the existing synthetic path unchanged apart from the extra summary fields.

Not tested

  • D3D12 (Model L runs on the HIP backend only so far); real game frames (synthetic frames only); other DLL versions.
  • Why post differs at that one pixel (edge handling with large C is the first suspect); left for the post owner.

Refs #89

…ghts), largest difference and magnitudes per stage

l_frame_check.py --prepare --model <model.wgcm> [--map <map>] runs the HIP frame check with the converter's
Model L file in place of the synthetic model: the runtime checks it against the map (default: the shipped
preset-L map) and the reference gets the values the file holds. Synthetic frames as before; the model file
stays in the build folder. The summary now gives per stage the largest difference, the non-finite values on
each side and the largest finite magnitude on each side.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…frame

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…frame

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