Repository navigation
Post: exact instruction cuts in the history and filter passes - #270
Merged
Merged
Conversation
…entical - history interior base as one mad_u24 with an opaque constant (-1 VALU per Catmull-Rom sample) - horizontal 5-tap pass: the four outputs share the min / max of their overlapping tap windows (6 + 6 three-input min / max instead of 8 + 8; the ring taps are finite FP16 values >= +0, so the grouping does not matter) - staging fetch: the wave-uniform footprint row as mad(.., -0) so it stays on the scalar unit - OP_POST_MUTANT (test-only define): mutants of the horizontal range for the byte check Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…for the byte check WG_POST_CUTS limits the history base fold and the shared horizontal min / max to the 3 x f32 row form and the direct forms, whose bytes the checks cover; post_tf_p12_diet_vsit and its texture-output form compile to the same DXIL as before. OP_POST_MUTANT=4 (test-only) offsets the history base so the byte check can show it reaches every form, the analytic output filter included. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 17, 2026 04:47
phantoslayer21
added a commit
that referenced
this pull request
Nov 17, 2026
…s) into release-0.6.1 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three exact instruction cuts in Model M's post kernel (
clean/dx12/kernels/post.hlsl). The output is byte-identical to before.hist_prev + (ix - 1) 8 + (iy - 1) pitchis computed as onemad_u24(iy, pitch, ix 8 + C)with C =hist_prev - 8 - pitchkept opaque. Otherwise the driver splits the constant back into its parts. This saves one VALU per Catmull-Rom sample. The two expressions are equal mod 2^32, so the buffer offset and its range check are the same.max_num(kEncK * log2(x), +0)with x >= 1e-4 and kEncK > 0. NaN gives the +0 bound, log2 is +-0 only at x = 1 (where it is +0), and +inf gives the 2.45 bound. So no NaN and no -0 reaches the min / max, and the grouping cannot change a bit.mad(.., -0), which equals the product exactly. The driver then keeps it on the scalar unit (s_mul_f32in the ISA) instead ofv_mul_f32+v_cvt+v_readfirstlane.The cuts apply to the 3 x f32 row form and the direct forms (
WG_POST_CUTS). The RGBA16F row forms (post_tf_p12_diet_vsit,_tex) compile to the same DXIL as before.OP_POST_MUTANTis a test-only define holding the mutants used below.RGA (gfx1201), the direct kernel's hot path for one row pair: -11 VALU / -20 issue slots. VGPRs are at or below the previous count in every post kernel (direct 94), LDS is unchanged, and there are no SGPR spills.
Measured
Interleaved timing: fresh process per run, order reversed on odd rounds, 9 rounds, 1500 frames per run, synthetic Model M, direct route, D3D12 timestamps.
At 1440p Quality the frame median went from 2.1175 to 2.1155 ms (paired median -2.0 us, 7 of 9 rounds faster). At 1080p Quality the frame delta is within noise, so no frame gain is claimed there. Every timing run's 1500-frame output hash equals the previous build's.
Tested
post_tf_f32_p12_diet_vsit_direct): 1440p Q, 1080p Q, 4K Performance, 3440x1440 ultrawide, 1001x563 -> 1501x845 (odd size). A leg with padded input textures (WG_TEST_TEX_PAD=3) also ran identical, but the pad's effect was not verified: the harness prints no texture size;post_tf4_dl_f32_p12_diet_vsit_direct): native AA 2560x1440, ratio 1.33 (1920x1080 -> 2560x1440), native AA 1501x845;pmo/post_tf_f32_p12_mo_direct(1440p Q) andpmo/post_tf4_dl_f32_p12_mo_direct(native AA);output_filter=analytic): 1440p Q, native AA, odd size.clean/dx12/compare.py, every stage and state buffer):post_tf_f32_p12_diet_vsit(1706x960 -> 2560x1440 and 853x481 -> 1279x721) andpmo/post_tf_f32_p12_mo(motion at output resolution), all identical.public_gates.py: must-pass gates pass.Not tested
executor_d3d12.cpp, "render rectangle differs from the frame's render size"), and a mutant only in that copy is not caught. It shares the cut code with the tested copies.runtime.cpp).Record: RESULT-POST-EXACT-B1 (team notes).