shader: lower private LDS qword min, max and xor updates #995
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1002"
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 lambirou on 2026-11-23T20:38:41Z.
Change
Adds five non-return private gfx1030 LDS qword updates to the compute-store profile:
ds_xor_b64,ds_min_i64,ds_max_i64,ds_min_u64andds_max_u64. This completes the integer/bitwise qword family started in #941.ds_xor_b64updates both words independently. The min/max forms compare the high words first, signed throughasintfor the i64 forms and unsigned for the u64 forms, then compare the low words when the highs are equal.Files:
tools/compute_store_aot.pytests/compute_store_check.pydocs/experiments.mdREADME.mdRefs #941.
Verification
Commit
d293808onshader/lds-qword-minmax-xor, rebased on upstreammainat986e7f6.ctest --preset dev --no-tests=error -R '^compute_store_aot_lds_qword_(warp|hardware)$' -V: 2/2 passed. Both backends compared all 320 UAV words for groups 1 and 3 with 0 mismatches, and all 14 mutants were detected.ctest --preset release --no-tests=error -R '^compute_store_aot_lds_qword_(warp|hardware)$' -V: 2/2 passed with the same results.10.0.26100.10068. Hardware is AMD Radeon RX 9060 XT, driver32.0.32029.2010. The D3D12 debug layer was unavailable.controls()passes;python -B -m py_compile tools/compute_store_aot.py tests/compute_store_check.pypasses;tests/docs_links_check.pypasses (13 Markdown files, 211 links).tests/compute_store_check.py binary, because the localllvm-mc.exereturns "Permission denied". The gfx1013 CI job ran it with LLVM 15 and passed.Evidence and follow-up
The qword cases are source-built synthetic fixtures. Each new form has one readback case and at least one mutation. The min/max fixtures now use high
0x7fffffff + (thread_id & 1)for the prior value and0x80000000for the source, keeping the existing low words. Even lanes cross the signed high-word boundary; odd lanes repeat the high word, so every odd lane exercises the unsigned low-word tie-break. Swapping signedness first mismatches word 0; dropping the low-word comparison first mismatches word 34 for min and word 2 for max.The README compute row and the
docs/experiments.md#private-gfx1030-lds-word-accesssection are updated.Relationship to #943
The five storage forms overlap with draft #943. I compared both control sets. The carry, borrow and bitwise controls were already here; #943's distinct controls are the signed/unsigned swap and a low-word tie-break mutation. Both are now carried over, using the alternating high-word setup above. The comparison controls originated in #943 by stan495, and the commit records that credit. The five returning forms remain in #943; once this lands, #943 can drop the duplicated non-return forms and keep the returning forms.
AI-assisted (Codex).
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:43:43Z.
These five non-return forms overlap with the draft #943, which is stacked behind #942. Please compare the two independent control sets here before either is merged. This PR can be reviewed without waiting for the returning forms. Keep one implementation, carry forward distinct tests and author credit, and have #943 reconcile its scope once the non-return candidate lands.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:56:54Z.
The current fixture tests unequal high words only for signed comparisons and equal high words only for unsigned comparisons. I verified a single deterministic setup for all four: use high
0x7fffffff + (thread_id & 1)for the prior value and0x80000000for the source. Keep the existing low words. This makes even threads distinguish signedness and odd threads exercise unsigned low-word tie-breaking. Flipping signedness first mismatches word 0. Disabling the tie-break first mismatches word 34 for min and word 2 for max. The augmented LLVM 15 round-trip and both Release draws passed locally. Maintainer edits are disabled on the branch. Please carry over these two controls, or enable edits so I can push the tested patch.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-23T21:09:52Z.
Addressed both points in
d293808.I compared the #943 control set with this branch. The carry, borrow and bitwise controls were already present here; #943's distinct controls are the signed/unsigned swap and the low-word tie-break mutation. Both are now carried over, with credit to stan495 in the commit message. The returning forms stay in #943.
The min/max fixture now uses high
0x7fffffff + (thread_id & 1)for the prior value and0x80000000for the source, keeping the existing low words. This reproduces the proposed controls exactly: swapping signedness first mismatches word 0; dropping the low-word comparison first mismatches word 34 for min and word 2 for max.Verification:
ctest --preset dev --no-tests=error -R '^compute_store_aot_lds_qword_(warp|hardware)$' -V: 2/2 passed, 0 mismatches, all 14 mutants detected.ctest --preset release --no-tests=error -R '^compute_store_aot_lds_qword_(warp|hardware)$' -V: 2/2 passed with the same results.10.0.26100.10068. Hardware: AMD Radeon RX 9060 XT,32.0.32029.2010. Debug layer unavailable.binaryremains for CI because the localllvm-mc.exereturns "Permission denied".The PR body now records the #943 comparison and the updated evidence.