shader: lower pixel compare masks composed with VCC in a whole-quad tail (Part of #3309) #3401
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3401"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-28T21:51:37Z.
Change
Part of #3309. Refs #2413, #3210, #870, #3308. The work sits on the pixel path added in #3091.
A gfx1013 pixel tail in whole-quad mode can now combine a named two-SGPR compare mask with VCC. It handles
s_and_b64,s_or_b64ands_andn2_b64(S0 & ~S1), ands_mov_b64keeps the lane bit when the pair is copied. Some cases are still refused:s_mov_b32of either half refuses withcompare mask half overwritten.s_mov_b64,s_movk_i32, scalar arithmetic, a scalar load, or a copy whose source is no longer a 64-bit mask, drops the tracked bit. A later select then refuses withunproven graphics CNDMASK source.s_cselect_b64into the same pair keeps the new full mask instead.SCC read without an established wave-wide nonzero result.This tracking runs only in the pixel whole-quad tail (
whole_quadorexact_after_wqm). A vertex class-mask high-half overwrite still refuses asunproven graphics CNDMASK source, the same as on main.Verification
All results below are for commit
53a8f2ab5fe80af837958bd9caee4700e7e9ce8a, rebased onto main77d1ba4d63ba31abaf4ca3635d4159189a423201.Windows test PC (MSVC,
--preset dev,-j 1). The command was:It passed 7 of 7 with ctest exit 0.
native_pixel_compare_mask_warp,_hardware,_containerand_irall passed. Container and IR refused the new scalar-write cases and validatedcompare-cselect-mask.native_fixed_mesh57_compare_vcc_warpand_hardwarepassed. The reviewed stage pair links and creates a color PSO. Target zero(2,0)packed RGBA was0xffff00ff, with 1/8 non-clear pixels and argument guards intact.native_direct_containerpassed.An earlier commit,
30f6606b, failednative_direct_containeronvertex-class-mask-high-overwritebecause the tracker also ran on vertex compares.ed447c29limits it to the pixel whole-quad tail.53a8f2abdrops a tracked pair when a later scalar write the tracker does not itself rewrite overlaps it.On Linux, at
53a8f2ab:g++andclang++-std=c++20 -Wall -Wextra -Werror=narrowingof the lowering exited 0.python3 -B tests/native_pixel_compare_mask_check.pyand the same script inirmode exited 0.python3 -B tests/docs_links_check.pyexited 0.Evidence and follow-up
The fixture words are written by hand in
tests/native_pixel_compare_mask_check.py, with no game files or dumps. The diagonal draw coversx + y < 5.5, so pixel(4,0)is covered and(4,1)is a helper lane. The mask isy > 1under whole-quad execution, and VCC isx > 2after exact coverage returns. Uncovered pixels stay at the clear value, -1.Each negative control was shown to fail when its check was removed:
v_cndmaskguard let the container lower with the stale bit.s_andn2_b64 s[6:7], s[4:5], vccasvcc & ~mask, and the draw test expectspixels differ.s_mov_b64,s_movk_i32,s_add_u32, a scalar load, and a mismatched copy all compiled. They now refuse.The mask map is still not stored per edge, and a later
s_cmp_*does not clear an unknown SCC from a varying combine. The fixed-mesh readback is the slot 57 target, not the 8×2 fixture. Reproduction notes are indocs/experiments/pixel-compare-mask-vcc.md.Checklist
AI-assisted (Cursor)
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T04:36:33Z.
Review: CHANGES_REQUESTED
Request changes at
ed447c29. Reviewed by reading the diff and the sources at that head; one mutant result from a local run is noted below.Blocking:
mainrefuses.compare_masks/broken_compare_masksare only updated byv_cmp_*(src/gfx1013_direct_graphics.inl:2126-2129), bys_mov_b64from a tracked or tagged pair (:2187-2203), bys_mov_b32(:2204-2209) and by a combine (:2224-2225). No other SGPR writer inlower_graphicstouches them, andv_cndmask_b32takes the map entry beforegraphics_lane_mask(:2143-2149).s_mov_b64 s[20:21], exec;s_wqm_b64 exec, exec;v_cmp_gt_f32 s[4:5], v1, 1.0;s_mov_b64 s[4:5], 0;v_cndmask_b32 v4, 0, 1.0, s[4:5]. The literal source is operand 128, so the move skips:2187(i.src[0] <= 104) and is lowered as a numeric move that leavescompare_masks[4]. The select then uses the old compare bit, while the guest mask is 0 on every lane. Onmainthe select goes throughgraphics_lane_mask(main:2115), sees a constant in the analysisstateand refuses withunproven graphics CNDMASK source. The fixture tail has the same hole: adds_mov_b64 s[8:9], 0after the copy.s_mov_b64from an untagged numeric pair (knownis false at:2188-2190), fors_movk_i32, SOP2 arithmetic and SMEM loads into either half, and fors_cselect_b64into a tracked pair (:2265-2277). In the last casemainselects with the new full mask, and the head selects with the old compare bit. So "a later 32-bit write to either half refuses" holds only fors_mov_b32.s_mov_b64path, whencompare_mask_bitreturns nothing (:2195, tagged source with an offset or a mismatched high half), the destination keeps its old entry.:1991-1992. Alternatively use the map entry inv_cndmask_b32only whenstate[src]is still the tagged pair. Add a container control withs_mov_b64 s[8:9], 0after the copy that expects a refusal.Non-blocking:
compare_masksis not part of the per-edge state (graphics_registersis restored per edge at:1127and merged at:1182), so an entry made in one block is visible in a sibling block. All fixtures are straight-line.compare_scc_unknownis cleared only by a uniform combine (:2231). After a laters_cmp_*defines SCC,s_cselectstill refuses at:2026.:2424-2425is redundant while SCC is still undefined (alu.read(128)already refuses withgraphics register undefined on an incoming path: 128), and once SCC is redefined it is the same false refusal as above.compare_mask_bit(:2167-2168), broken propagation throughs_mov_b64(:2192-2194), the refusal at:2242-2243, and:2424-2425.Checked:
:2220-2222): OR, AND, and ANDN2 asS0 & ~S1withxor bit, 1on 0/1 values. SCC is written only for a uniform result (:2229-2235).(4,0)is covered (4.5 + 0.5 < 5.5),(4,1)and(5,0)are not; the mask at(4,0)is 0 and the quad read from(4,1)is 1; the two ANDN2 orders give different images. The fixed-mesh words decode tos_and_b64 s[6:7], s[4:5], vcc,s_mov_b64 s[8:9], s[6:7],v_cndmask_b32 v0, 0, 1.0, s[8:9].212d4b5ftogether with other open PRs), removing thexorfrom the ANDN2 lowering (:2222) failednative_pixel_compare_mask_warp,_hardwareand_ir;_container,native_direct_containerandnative_fixed_mesh57_compare_vcc_warpstill passed.prpreset filter (CMakePresets.json), and the new script is not intests/checks/python-linux. The evidence is the author's run in the PR body.add_test/set_tests_propertiesonly.git merge-treeagainstmain(212d4b5f) is clean.Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-29T12:47:43Z.
Fixed at
53a8f2ab5fe80af837958bd9caee4700e7e9ce8a. A scalar write the tracker does not itself rewrite now drops any compare-mask pair it overlaps, sov_cndmaskcannot keep the old bit. That covers a literal or numerics_mov_b64,s_movk_i32, scalar arithmetic, a scalar load, and a copy whose source is no longer a 64-bit mask.s_mov_b32still refuses as a half overwrite.s_cselect_b64into that pair keeps the new full mask, and the IR select reads that mask rather than the replaced compare. The branch is rebased onto main77d1ba4d.Windows test PC (MSVC,
--preset dev,-j 1), at that head:ctest --preset dev --no-tests=error -j 1 -R '^(native_pixel_compare_mask_(warp|hardware|container|ir)|native_fixed_mesh57_compare_vcc_(warp|hardware)|native_direct_container)$' -E 'startup_audio_(output|pacing|provider)': 7/7 passed, exit 0 (native_fixed_mesh57_compare_vcc_warp,native_fixed_mesh57_compare_vcc_hardware,native_direct_container,native_pixel_compare_mask_warp,native_pixel_compare_mask_hardware,native_pixel_compare_mask_container,native_pixel_compare_mask_ir)compare-literal-zero,compare-literal-copy-zero,compare-numeric-mov,compare-movk-high,compare-add-high,compare-smem-low,compare-mismatched-copy,compare-broken-copy,compare-broken-combine,compare-missing-vcc) and validatedcompare-cselect-mask.Not done in this head: the mask map is still not stored per edge, and a later
s_cmp_*does not clear an unknown SCC from a varying combine.AI-Assisted
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:55:27Z.
Review of head
53a8f2ab(rebased onto77d1ba4d).git merge-tree --write-tree --name-only origin/main 53a8f2abagainstmainaf1cab5cexits 0. CI at the head passes. Read only, nothing built or run.Checked:
53a8f2abcloses the blocking point from the review ated447c29.UnclaimedMaskReleaseruns wheninstructionreturns or throws. In the compare tail, it erases every pair that overlapsGraphicsMaskRegions::scalar_width(i)dwords fromi.dst, unless the tracker setclaimed. The width covers SMEM, VOPC, SOP1/SOP2/SOPK andv_readlane_b32/v_readfirstlane_b32. A literal or numerics_mov_b64,s_movk_i32, SOP2 arithmetic, an SMEM load,s_cselect_b64and a tracked copy whosecompare_mask_bitcomes back empty therefore drop the stale bit. Theclaimed = truesites are exactly the four tracker writes: v_cmp, trackeds_mov_b64(two branches),s_mov_b32broken, and the combine.compare-literal-copy-zeroistail(15, 4, 106, after=[sop1(4, 8, 128)]), thes_mov_b64 s[8:9], 0after the copy. Next to it arecompare-literal-zero,-numeric-mov,-movk-high,-add-high,-smem-lowand-mismatched-copy, all expecting theunproven graphics CNDMASK sourcerefusal.compare-cselect-maskchecks in IR that theicmp nereads the newselect ... 4294967295, i32 0. Dropping the release body would make the UNPROVEN cases lower, so the container check pins it.v_mad_u64_u32is refused inpixel_stage, andv_add_co_u32has no C++ lowering.MUST
ed447c29is still the review on record. I'm leaving the merge to that re-review and have nothing else blocking.SHOULD
-Renderruns the in-process pixel translator by default. Once this lands, these compare-mask tails are lowered in default runs, not only opt-in ones. So the two remaining gaps the author lists matter there: the mask map is not part of the per-edge state, and an unknown SCC is not cleared by a laters_cmp_*. All fixtures are straight-line. A follow-up issue, or a refusal when a tracked entry reaches a join, would bound the first gap.NIT
!*whole_quad && !*exact_after_wqm) and skips the erase when the tail has already ended. Entries made in the tail then outlive it. That matters only if a second whole-quad region can begin later in the prologue. I found no case of that by reading and did not try to construct one.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T13:46:08Z.
Review: COMMENTED
Review at
53a8f2ab. My changes request oned447c29is resolved byUnclaimedMaskRelease(src/gfx1013_direct_graphics.inl:1683-1702). Not approving yet: item 1 below is a regression againstmain. I will approve once it is fixed. Reviewed by reading the diff and the sources at that head and atmain4b0586d4; nothing was built or run for this pass.Blocking point from
ed447c29: fixed (code reading).src/gfx1013_direct_graphics.inl:1683-1702:UnclaimedMaskReleaseruns on every exit ofinstruction(return or refusal). In the tail it erases each tracked or broken pair overlapped byscalar_width(i)dwords fromi.dst, unless the tracker setclaimed.claimedis set only where the tracker rewrites the entry itself::2159,:2226,:2230,:2242,:2261.v_cndmask_b32falls through tographics_lane_mask(:2180), which is themainbehavior. So a literal or numerics_mov_b64,s_movk_i32, SOP2 arithmetic and an SMEM load refuse as onmain, ands_cselect_b64selects with the new full mask.s_mov_b64whose source gives no bit (:2227returns nothing) no longer setsclaimed, so the destination entry is erased too.:2314-2318), so register 106 read at:2213is always a 0/1 lane bit.compare-literal-copy-zero(tests/native_pixel_compare_mask_check.py:92-94), plus-literal-zero,-numeric-mov,-movk-high,-add-high,-smem-low,-mismatched-copy, andcompare-cselect-maskwith the IR check at:303-305.MUST
mainlowers is refused (code reading).src/gfx1013_direct_graphics.inl:2237-2243computesbase = i.dst & ~1uwithout looking atstage.wave32, and:2156records the compare on wave32 as well. On a wave32 pixel stage in whole-quad mode, before the exact restore:v_cmp_gt_f32 s4, ..;s_mov_b32 s5, 0;v_cndmask_b32 .., s4. The move marks pair 4 broken and the select refuses at:2175-2176withcompare mask half overwritten. Onmainthe compare tags onlys4(src/gfx1013_compute_native.cpp:714-715), the move changes onlys5, andgraphics_lane_maskaccepts a wave32 mask from its low word alone (src/gfx1013_direct_compute.inl:2962-2964at4b0586d4), so the select lowers. The result is a refusal, not a wrong value. On wave32s5is an ordinary register, so the sequence is plausible. Fix: gate thes_mov_b32pair-break branch at:2237-2243on!stage.wave32. A wave32 container case with that sequence expecting success would pin it; no fixture in this PR is wave32.Non-blocking:
SHOULD
compare_masksis not part of the per-edge state, so an entry recorded in one block is visible in a sibling block or at a join. All fixtures are straight-line. A refusal when a tracked entry reaches a block boundary, or a follow-up issue, would bound it.compare_scc_unknownis cleared only by a uniform combine (:2265-2267). After a laters_cmp_*defines SCC,s_cselect(:2056-2057) and a scalar branch (:2460-2461) still refuse.NIT
compare-broken-copydoes not pin the propagation at:2223-2226(code reading). With that branch removed,s_mov_b64 s[8:9], s[4:5]reachescompare_mask_bit(4)at:2227, which refuses at:2198-2199with the same message, so the case still passes. The branch only changes behavior when the broken copy is never read as a mask (then it lowers instead of refusing), and no case covers that.scc_program(varying=False)(tests/native_pixel_compare_mask_check.py:61-70) iss_or_b64of a true and a false compare, read bys_cselect_b32with expected value 1.0. Writing a constant 1, or the left operand's bit, to SCC at:2266would pass. A second uniform case with a false result (for examples_and_b64of the same two compares, expecting 0.0) would catch both.:1692tests the tail state after the instruction, so entries recorded in the tail outlive it. They are only read inside the tail, and I found no way to re-enter whole-quad mode after a compare (:2045requiresscalar_entry, which a compare clears at:2051-2055).Checked:
git merge-treeof the head againstmain4b0586d4is clean. The four later commits onmaindo not touchsrc/gfx1013_direct_graphics.inl.prpreset; the 7/7 result is the author's run in the PR body.add_test/set_tests_propertiesonly.Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T13:58:08Z.
Review: CHANGES_REQUESTED
Request changes at
53a8f2ab, reviewed integrated overmain4b0586d4(treed8bfbb92, clean merge,git diff --checkclean).What the earlier review at
ed447c29asked for. The straight-line stale pair is fixed. With the release body disabled,compare-literal-zero,-literal-copy-zero,-numeric-mov,-movk-high,-add-high,-smem-lowand-mismatched-copystop refusing and three tests fail (mutant M1 below).v_add_co_u32-style carry-outs are not a hole:gfx1013_direct_compute.inl:3535refuses them for a pixel stage.Blocking
A tracked pair crosses a control-flow edge and gives a wrong select where
mainrefuses.compare_masksis one map for the whole function, filled and erased in emission order, andin_compare_tail()is true for the whole-quad region before coverage returns, where branches are allowed (the edge refusal at:1975covers onlyexact_after_wqm). Program, using the helpers intests/native_pixel_compare_mask_check.py:SCC is 1, so the guest always takes the
thenpath andv0is 0 on every lane. At this headcompile_dxil ... gfx1013-container-psexits 0, the DXIL validates, and the join selects on they > 1compare (%t9 = icmp ne i32 %t5, 0with%t5the compare from the entry block). Drawn with the fixture's vertex shader on WARP,offscreen_check warp --startup-pixel-wordsagainst the all-zero reference reportspixel mismatch (0,1): expected 00000000,... actual 3f800000,...,4 of 16 pixels differ, and it matches they > 1image exactly. Onmain4b0586d4the same blob refuses withnative compute +0x24: unproven graphics CNDMASK source. Thethenblock erases the entry, theelseblock is emitted later and puts it back from the tagged state, and the join then finds an entry that only holds on one path.Same cause, invalid IR instead of a refusal. Replace the two arms with a
thenblock that redefines the pair:native_pixel_ir_dumpexits 0 at this head and the join reads a value defined only in thethenblock.compile_dxilthen fails in DXC withInstruction does not dominate all uses! %t14 = zext i1 %t13 to i32.mainrefuses withnative compute +0x20: unproven graphics CNDMASK source.Suggested direction (not tried): use a map entry in
v_cndmask_b32and incompare_mask_bitonly when it was recorded in the current block, and clear the map at every block entry, so anything that crosses an edge falls back tographics_lane_maskand the per-edgestate, as onmain. Or refuse when the whole-quad region is not straight-line. Please add both programs as container controls that expect the refusal.The title run of this head failed twice. prwatch built
53a8f2abmerged onto the baseline commitaf1cab5c:[fail] judgement: Judged worse than the baseline: black-frame (at before-1, after-1, before-2, after-2, before-3, after-3, before-4, after-4). Confidence medium.[fail] repeat: Failed again on a re-run (job 44).I have not tied this to finding 1 or 2.
Non-blocking
compare_scc_unknownis still cleared only by a uniform combine, so a laters_cmp_*followed bys_cselector an SCC branch is refused although SCC is defined again. The PR body says so.prpreset filter, and the script is not intests/checks/python-linux. The results below are from my machine.What I ran
Built
dev(full build), thenctest --test-dir out/build/dev --no-tests=error -j 4 -R '^(native_pixel_compare_mask_(warp|container|ir)|native_fixed_mesh57_compare_vcc_warp|native_direct_container|native_fixed_mesh57_mask_warp)$': 6 of 6 passed.native_pixel_compare_mask_hardwareandnative_fixed_mesh57_compare_vcc_hardwarewith-j 1and the debug layer on: 2 of 2 passed, no skips. Release was not built, because the findings above already decide the verdict.Mutants in
src/gfx1013_direct_graphics.inl, each rebuilt and run against the five non-hardware tests of this PR:_warponly); M3 OR lowered as AND; M4 combine always uniform; M5 broken check incompare_mask_bitoff; M6 broken check inv_cndmask_b32off; M8compare mask is not a 64-bit lane maskrefusal off; M9in_compare_tail()always true (native_direct_containeronly); M10s_cselectSCC refusal off; M12v_cndmask_b32dropped fromexact_mask_select; M13 release erases the odd register number instead of the pair base; M14s_mov_b32break not claimed; M16 trackeds_mov_b64does not record the copy.s_mov_b64no longer propagates a broken source (the copy itself then refuses with the same message, so no case tells a broken pair that is copied and never selected from one that is selected); M11 the SCC refusal on a two-way branch removed (no case has a branch after a varying combine).v_cmp_*does not record or claim. The select and the combine then reach the same bit through the taggedstate, so this entry is only a second route to it.Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, DXC from Windows SDK 10.0.28000.0, debug layer on for the hardware tests.
CI:
Build and test on Windowspasses on53a8f2ab.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T15:30:38Z.
@SimSalabimse Taking this over since there has been no activity for 2 h; will hand back if you resume.
Last movement here: head
53a8f2abpushed at 12:37 UTC, your comment at 12:47 UTC. Two reviews at that head are open: mine (13:46 UTC) and pigalot's changes request (13:58 UTC).Plan:
fd22219e,a081635b,53a8f2ab) unchanged, with their authorship, merged with currentmain. It will reference this PR and #3309.s_mov_b32pair-break branch (src/gfx1013_direct_graphics.inl:2237-2243) on!stage.wave32, with a wave32 container case that expects success.compare_scc_unknownafter a laters_cmp_*, the single-pixel fixed-mesh check, and the two surviving mutants (M7, M11).Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-29T16:00:39Z.
@Leyukaka I can take the remaining review fixes on this branch if you haven't started the follow-up. If you have, I'll leave it with you.
AI-Assisted
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T16:05:03Z.
@SimSalabimse Handing back: the PR stays with you, and I will not open a separate one.
I had started.
Leyukaka:takeover-3401-pixel-compare-vccis your three commits merged withmain5de0b114, plus two commits you can cherry-pick or merge into this branch:9193f9c4: gates thes_mov_b32pair-break on!stage.wave32, with a wave32 container case (compare-wave32-high-write).76b760c0: clears the tracked compare masks at block entry, with pigalot's two programs as refusal controls (compare-join-after-clear,compare-join-after-redefine).At
76b760c0,native_pixel_compare_mask_(container|ir|warp|hardware),native_direct_container,native_fixed_mesh57_compare_vcc_(warp|hardware)andnative_fixed_mesh57_mask_warppass (8 tests). Not done: the mutation checks for both commits, pigalot's point 3, andcompare_scc_unknownfrom my 13:46 UTC review.Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-29T16:49:57Z.
Fixed at
2211dac07b58740d1beecf8cfe5975aabb126f44. These are Leyukaka's two commits, cherry-picked onto53a8f2abso the earlier three commits are unchanged.61df3c5fkeeps a wave32 compare mask when its high half is written (compare-wave32-high-write).2211dac0clears the tracked compare masks at block entry (compare-join-after-clear,compare-join-after-redefine).Windows test PC (MSVC,
--preset dev,-j 1), at that head:ctest --preset dev --no-tests=error -j 1 -R '^(native_pixel_compare_mask_(warp|hardware|container|ir)|native_fixed_mesh57_compare_vcc_(warp|hardware)|native_direct_container|native_fixed_mesh57_mask_warp)$' -E 'startup_audio_(output|pacing|provider)' --output-on-failure: 8/8 passed, exit 0, none skipped:native_fixed_mesh57_mask_warp,native_fixed_mesh57_compare_vcc_warp,native_fixed_mesh57_compare_vcc_hardware,native_direct_container,native_pixel_compare_mask_warp,native_pixel_compare_mask_hardware,native_pixel_compare_mask_container,native_pixel_compare_mask_ir.native_pixel_compare_mask_container):validated compare-wave32-high-write(compiles, no refusal),refused compare-join-after-clearandrefused compare-join-after-redefine; the check assertsunproven graphics CNDMASK sourcein stderr for both.native_pixel_compare_mask_iralso printsir refused compare-join-after-clearandir refused compare-join-after-redefine.Not done in this head: mutation checks for both commits, pigalot's point 3, and
compare_scc_unknownafter a laters_cmp_*.AI-Assisted
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T16:54:12Z.
Re-review of the delta
53a8f2ab→2211dac0(read-only; nothing built or run here). Verdict: no new MUST from me, but not mergeable yet. Leyukaka's CHANGES_REQUESTED review (ated447c29) and pigalot's (at53a8f2ab) are both still the recorded state.Delta:
61df3c5fand2211dac0are Leyukaka's9193f9c4and76b760c0.git patch-id --stablegives the same IDs for each pair (f0cfcab5,3ae05268).53a8f2ab). Thes_mov_b32pair-break branch is now gated on!stage.wave32. On wave32s5is an ordinary register, sos_mov_b32 s5, 0no longer marks pair 4 broken. The select then goes throughUnclaimedMaskReleaseandgraphics_lane_maskas onmain. Control:compare-wave32-high-write, expected to lower.block_entriesis filled fromgraphics_blocks(keys are leader pcs, the same unit asi.pc).compare_masksandbroken_compare_masksare cleared at the top ofinstructionwhenpcis a block entry, before any tracker or release runs. A join or sibling block therefore reads the pair through the per-edgestate, which ismain's path, so the map can only add selects within one block. Controls:compare-join-after-clear(pigalot's program) andcompare-join-after-redefine, both expected to beUNPROVEN.Checks at
2211dac0:git merge-tree --write-tree origin/main 2211dac0exits 0 (mainc4b8a41b), andgit diff --checkexits 0. CI run 46286122842 is green: Windows100% tests passed out of 82, gfx1013 and Linux Python pass.SHOULD
native_pixel_compare_mask_check.py(0 hits fornative_pixel_compare_maskorcompare-joinin the run's log). Leyukaka's 8/8 was at76b760c0on a different base (main5de0b114). Please postnative_pixel_compare_mask_(container|ir|warp|hardware)andnative_direct_containerat2211dac0. Also post the two mutations Leyukaka listed as not done: dropping!stage.wave32should redcompare-wave32-high-write, and dropping the block-entry clear should redcompare-join-after-clear.53a8f2ab: pigalot's point 3 (the black-frame result needs a run on the new head) andcompare_scc_unknownnot being cleared by a laters_cmp_*. If the latter stays out of scope, the PR body should say so.AI-assisted review.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T17:13:09Z.
Review: APPROVED
Approve at
2211dac0. Diff reading only; nothing built or run for this pass.53a8f2abis resolved: thes_mov_b32pair-break is gated on!stage.wave32(src/gfx1013_direct_graphics.inl:2245), withcompare-wave32-high-writeexpecting success. pigalot's points 1-2 are resolved by the block-entry clear ofcompare_masks/broken_compare_masks(:1683-1686), withcompare-join-after-clearandcompare-join-after-redefineexpecting a refusal.61df3c5fand2211dac0are the two commits I handed back (9193f9c4,76b760c0):git range-diffreports both pairs as identical.53a8f2ab, no run at this head yet), andcompare_scc_unknownbeing cleared only by a uniform combine (it only adds refusals).Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T17:19:29Z.
Status at
2211dac0(head unchanged since my 16:54Z re-review; read-only, nothing built or run here). Not merged. Leyukaka has approved2211dac0, so the only block left is pigalot's CHANGES_REQUESTED at53a8f2ab. GitHub still reportsreviewDecision: CHANGES_REQUESTED/mergeStateStatus: BLOCKED.compare-join-after-clear/compare-join-after-redefineare the controls for them (see my previous comment). Point 3, the black-frame title run, has not been re-run on this head.git merge-tree --write-tree origin/main 2211dac0still exits 0 on the new main26df1826. CI at this head: SUCCESS=3, SKIPPED=2.native_pixel_compare_mask_*,native_direct_container) or the two mutations at this head.This can merge once pigalot's review is updated or dismissed.
AI-assisted review.
Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-29T17:24:11Z.
Mutations at
2211dac07b58740d1beecf8cfe5975aabb126f44, as asked. Local only.src/gfx1013_direct_graphics.inlwas restored after each mutant (git statusclean,git diffempty, HEAD unchanged). The 8/8 of the new controls at this head is in https://github.com/R0Y00/Xbox2Windows/pull/3401#issuecomment-7259211168Windows test PC (MSVC,
--preset dev,-j 1). Same five tests each time:native_direct_container,native_pixel_compare_mask_warp,native_pixel_compare_mask_hardware,native_pixel_compare_mask_container,native_pixel_compare_mask_ir.Unmutated head, before and after the mutants: 5/5 passed, none skipped. Container:
validated compare-wave32-high-write,refused compare-join-after-clear,refused compare-join-after-redefine. IR alsoir refusedboth join cases.Dropped
!stage.wave32from thes_mov_b32pair-break, leavingin_compare_tail() && i.name == "s_mov_b32" && i.dst <= 105. 3/5 passed, 2 failed, none skipped.native_pixel_compare_mask_containerfailed oncompare-wave32-high-write:native compute +0x14: compare mask half overwritten.native_direct_containerruns the samecontainer_cases()and failed at that case with the same reason.Replaced the block-entry
compare_masks.clear();/broken_compare_masks.clear();with comments. 2/5 passed, 3 failed, none skipped.native_pixel_compare_mask_containerandnative_pixel_compare_mask_irfailed oncompare-join-after-clear: the program compiled (empty stderr) instead ofunproven graphics CNDMASK source.native_direct_containerfailed in that same loop on a refusal assert, with empty stderr. The test stops there, socompare-join-after-redefinewas not reached on this mutant.compare-wave32-high-writestill validated. Warp and hardware still passed.Not done: pigalot's point 3 (the black-frame title run), and
compare_scc_unknownafter a laters_cmp_*. Not merging.AI-Assisted
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T17:52:00Z.
Review: APPROVED
Approve at
2211dac0. Retested integrated overmain26df1826(treede514147, clean merge,git diff --checkclean). This supersedes my changes-requested review on53a8f2ab.Earlier blocking findings
src/gfx1013_direct_graphics.inl:1683-1686), so a join reads the pair through the per-edge state as onmain. My program is nowcompare-join-after-clear;native_pixel_ir_dumprefuses it withnative compute +0x24: unproven graphics CNDMASK source, the same refusal asmain.compare-join-after-redefinerefuses withnative compute +0x20: unproven graphics CNDMASK source.2211dac0merged onto the baseline commitaf1cab5c(job 52): pass, judged no worse than the baseline.The wave32 gate on the
s_mov_b32pair-break (:2245) is right as far as I traced it: on wave32 the odd register is released as an ordinary scalar write, and the select goes back throughgraphics_lane_mask.compare-wave32-high-writelowers.I also checked whether
compare_scc_unknown, which is still one flag for the whole function, can let a wrong SCC read through across blocks. It cannot in the cases I tried: with a varying combine in the arm emitted first and a uniform combine in the other, as_cselect_b32at the join refuses withgraphics register undefined on an incoming path: 128, because a varying combine also leaves register 128 empty on its edge. With the arms swapped, or both varying, it refuses with the SCC message. With both uniform it lowers.Non-blocking
compare_scc_unknownis not cleared by a laters_cmp_*(extra refusals only), the fixed-mesh shader reads a single pixel, and CI does not run the new tests on a pull request.What I ran
Built
dev(full) andrelease(compile_dxil,offscreen_check,native_pixel_ir_dump,startup_indirect_draw_indexed), thenctest --test-dir out/build/<preset> --no-tests=error -j 4 -R '^(native_pixel_compare_mask_(warp|container|ir)|native_fixed_mesh57_compare_vcc_warp|native_direct_container|native_fixed_mesh57_mask_warp)$': 6 of 6 passed in Debug and in Release/O2.native_pixel_compare_mask_hardwareandnative_fixed_mesh57_compare_vcc_hardwarewith-j 1and the debug layer on: 2 of 2 passed in Debug and in Release, no skips.Mutants of the two new commits in
src/gfx1013_direct_graphics.inl, each rebuilt indevand run against the five non-hardware tests of this PR. The file was restored afterwards, the five tests pass again andgit diff --quietis clean.!stage.wave32dropped (_container,native_direct_container); B block-entry clear removed (_ir,_container,native_direct_container); C only the broken set cleared (same three); Eblock_entriesnever filled (same three); F clear on every pc that is not a leader (those three and_warp); G wave32 gate inverted (_ir,_container,native_direct_container).Mutants A and B are also the negative controls for the three new cases: without each fix the case behaves as it did at
53a8f2ab. The 13 killed and 2 surviving mutants from my review at53a8f2abcover lines these two commits do not touch; I did not rerun them.Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, DXC from Windows SDK 10.0.28000.0, debug layer on for the hardware tests.
CI:
Build and test on Windowspasses on2211dac0.This reply was AI-assisted.