Repository navigation
[BUNDLE] Shader instruction lowering: 10 PRs, #156 #162 #169 #368 #379 #990 #1021 #1048 #1052 #1053 (rebuilt on main 70564ae) - #1492
Conversation
The ISA's special cases in its order: a NaN numerator or denominator comes back quieted, 0/0 and inf/inf give NaN, x/0 and inf/x a signed infinity, 0/x and x/inf a signed zero, otherwise |S0| with the quotient's sign. Worked on the f32 values of the f16 operands, which are exact.
The ISA's "exponent of S0 all ones -> overflow" check runs before the final |S0| case, so a NaN quotient with a finite, non-zero numerator and denominator gives sign | infinity, as measured on gfx1036 hardware. The zero, infinity and invalid checks still come first.
The d16 forms of the typed buffer loads return each channel as 16 bits, two per VGPR, low half first; the decoder already sizes their data that way. The lowering only treated `buffer_` names as d16, so a tbuffer_load_format_d16_* went through the 32-bit path: the first VGPR got channel x as a 32-bit value (the f32 bits of 1.0 instead of the f16 pair (1.0, 2.0)) and the other channels were dropped. The format path now packs its channels for d16: integer formats keep their low 16 bits, the other formats become f16 (as the MUBUF d16 path converts them).
SDATA on s_atc_probe and s_atc_probe_buffer is a 7-bit immediate, the buffer resource is four dwords, and GLC/DLC are not operands of either.
buffer_gl0_inv and buffer_gl1_inv name a buffer but read no descriptor, so resource tracking refused them before lowering. Skip descriptor tracking for _inv buffer instructions and lower the pair to nothing, as the existing scalar cache instructions already are. Add a synthetic full-pipeline test.
The high dword of the 48-bit product whose low dword v_mul_u32_u24 and v_mul_i32_i24 already give: the low 24 bits of each operand, zero- or sign-extended, through the existing mul_hi. The test module gets lowers_valu, a one-thread compute program with root constants in v1..v4 and a buffer store of v0 (built with lower_with), so a vector instruction can be checked for lowering without a GPU. AI-assisted (Claude Code).
src2 plus the sum of the unsigned differences |a - b| of the operands' bytes (v_sad_u8), halves (v_sad_u16) or whole dwords (v_sad_u32), wrapping at 32 bits. v_sad_hi_u8 adds the byte sum shifted to the high half; v_msad_u8 leaves out a byte whose mask byte (src1) is 0. AI-assisted (Claude Code).
Buffer format loads divide a UNORM or SNORM field by its largest value. A host may divide through a reciprocal and land just below 1.0: on an RX 9070 (RDNA 4), 16_16_UNORM's 65535 loaded through the d16 path as the half 0x3BFF instead of 0x3C00. The largest value now selects 1.0, and an SNORM field's two lowest values select -1.0, as the formats define them.
|
Investigated this bundle and cherry-picked from it. Stack: main The whole-bundle merge was entangled with the #1319/#1402 base and a large mod.rs test-module divergence, so instead I cherry-picked the components matching our runtime refusals: #1084, #305, #306, #176, #587. Measured: compute emission 493/560 (+3); #305 cleared our 64-bit image atomics (2 → 0); no regressions; world stable. Finding for the bundle's framing: these instruction-lowering fixes sit deeper than the frontier that dominates our runtime refusals — "a descriptor's address or format read as data" (50), "an address not from a root parameter" (25), "an address from a phi" (12). Until those descriptor/address classes clear, the instruction fixes give marginal runtime gain (the same shaders stop at the earlier descriptor gap). The bundle is still valuable as those clear. AI use: Qwen Code; local measurements, user-confirmed visuals. No game data posted. |
Offline measurement on a retail dump: #98 costs 31 programs; the other 20 PRs change no countRecommendation: Drop #98 from this bundle until it handles these programs. All the PRs measured here lose nothing else. I ran
What #98 loses. All 31 programs fail with "a whole-wave section step the simulation does not follow". They validate on #1402, and they validate again once only the #98 merge is reverted. Another 15 programs that already failed move to the same reason: 11 from "a structured buffer of unknown stride" and 4 from "image_gather4_l". This matches what zed6000 measured for #98 alone on The other 20 PRs change no count on this data. Without #98, the bundle and #1402 agree program by program. That is expected for single-instruction lowerings and hardware tests whose instructions the remaining failures do not reach first. Their effect on output correctness is not measured here. These counts show only that programs translate and pass the validator. They do not show that the output is correct. I did not render anything. No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
c1e74a3 to
b372f6f
Compare
…#1504, verified together Merges Marvisak#1145 Marvisak#343 Marvisak#1042 Marvisak#1303 Marvisak#477 on top of the stack of Marvisak#1504 (Marvisak#1319, Marvisak#1402, Marvisak#1492, Marvisak#1504, on main ffe310e), each head unchanged, no conflicts and no changes of mine. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (406 passed, 6 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for the measurement, and for the two runs that agree on #98 (this one and #1247's). #98 is out: |
b372f6f to
5bbc098
Compare
…#1504, verified together Merges Marvisak#1145 Marvisak#343 Marvisak#1042 Marvisak#1303 Marvisak#477 on top of the stack of Marvisak#1504 (Marvisak#1319, Marvisak#1402, Marvisak#1492, Marvisak#1504, on main ffe310e), each head unchanged, no conflicts and no changes of mine. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (406 passed, 6 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…sak#98, Marvisak#334 to Marvisak#492, validation) The line rebuilt on the bundles' current heads (Marvisak#1402 119b763, Marvisak#1492 5bbc098 without Marvisak#98, Marvisak#1504 1d41891, Marvisak#1511 ca601f0) with every merge replayed, and the merges after this file's first version (Marvisak#334, Marvisak#346, Marvisak#1024, Marvisak#211, Marvisak#492): merge order, the runner's numbers on 967d3ae (RTX 571, WARP 570 + the known Marvisak#1084 failure, all features 580; Marvisak#98's one test leaves), what is not included (Marvisak#98, Marvisak#282 for Marvisak#346, Marvisak#693 for Marvisak#1024, Marvisak#306's latest commit), and the open pull requests whose head is contained here (109, from the 18:24 collection). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@MamaLeVrai thanks, measured as you suggested, offline on the same RTX 5060 Ti (
AI use: Claude Code (Claude Opus 5.5); checked by mrejecutor. |
ea33d12 to
8fb97d2
Compare
|
MrEjecutor: thank you, and for keeping the two counts apart. A note on what moved since: AI-assisted (Claude Code); no game data. |
|
Automated triage for the maintainers. Proposed close: a bundle that only re-packages other people's pull requests. This branch combines other contributors' open PRs (#156, #162, #169, #368, #379, #990, #1021, #1048, #1052, #1053) through merge commits. Its own merges add no change beyond combining both sides in The description contains instructions addressed to agents verifying the PR (fetch, check out and run cargo); automated triage did not follow them. This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the Generated by Claude Code |
One PR in place of 10. After
mainmoved, this bundle keeps the 10 of its earlier 20 PRs that still merge; the left-out ones are listed below. The earlier description follows, and may mention PRs or measurements that no longer apply. Twenty open shader PRs that add or fix the lowering of single instructions (SAD, frexp and ldexp, f16 division fixup, packed and 16-bit integer ops, scalar SCC flags, buffer and image details, mesh output bounds, hardware tests), merged on top of the stack #1319 and #1402. Every head is merged unchanged ontomain(70564ae, after the maintainer's 28 commits of Nov 24, 22:36 CET), and the result is built and tested together.What is inside
344704e025d6889e8b645391bccf47ebd83f5ecb6abe78d67fa5b03d71ad1a67b57e8e8d41b2472e1393320dfaChanges made while bundling
No PR was edited, and there is no hand resolution: a PR that does not merge as it is, is left out (below).
Left out, and why
Rebuilt on the new
main. The earlier version of this bundle had 20 PRs; 10 merge here in order, each checked with clippy as it went in.main(or with an earlier PR of this bundle) in crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/valu_tests.rs.main(or with an earlier PR of this bundle) in crates/victory-shader/src/emit/lower.rs.main(or with an earlier PR of this bundle) in crates/victory-shader/src/emit/valu_tests.rs.main(or with an earlier PR of this bundle) in crates/victory-shader/src/emit/valu_tests.rs.main(or with an earlier PR of this bundle) in crates/victory-shader/src/emit/valu_tests.rs.main(or with an earlier PR of this bundle) in crates/victory-shader/src/emit/valu_tests.rs.main(or with an earlier PR of this bundle) in crates/victory-shader/src/emit/valu_tests.rs.main(or with an earlier PR of this bundle) in crates/victory-shader/src/emit/lower.rs.main(or with an earlier PR of this bundle) in crates/victory-shader/src/io.rs.v_permlane16_b32in whole-wave sections): it was in the first version of this bundle and is out of this one. sinan-cmyk's offline measurement on a retail dump (comment below) shows it loses 31 programs that validate on [BUNDLE] High-yield shader PRs (+295/+520/+153/+117 programs in #1247): #1067 #305 #306 #176, stacked on #1319 #1402 (all fail with "a whole-wave section step the simulation does not follow"); reverting only its merge brings them back, and Offline benchmark of 25 open shader PRs on a retail dump: what each one unblocks #1247 had measured 29 compute programs lost for Shaders: model v_permlane16_b32 in whole-wave sections #98 alone onmain. It needs to handle those programs first.v_sad/v_msadfamily as Shaders: lower v_sad_u8, v_sad_hi_u8, v_sad_u16, v_sad_u32 and v_msad_u8 #162, which is in.v_cndmask_b32masks as Shaders: a select or carry-in on an untracked mask tests this lane's bit #1084 (in [BUNDLE] Lane-mask, scalar descriptor read and cube-sample shader fixes: #1057 #1073 #1074 #1084 #953 #1056 #1015 #1055 #563 #1004 #1319).structure.rs) or failed to compile or lint together with the PRs already in.Verification
Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --lockedmain: 476 passed, 7 ignored)The title was not run, so this says nothing about in-game effect. No game data is used or committed.
Re-verify in one go
To confirm that no component PR moved since this was built, compare each
Headabove withgh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.If this lands
The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.
AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code