Repository navigation
Conversation
|
Testing this right now, I ran into the same bug |
|
Tested
AI-assisted (DeepSeek V4.1 Flash coding agent). |
|
This made it further but I'm still not getting a world render but the PR is sound. |
|
Follow-up after looking at the rest of the queue:
No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent). |
c78ccf7 to
4baaee7
Compare
|
Thanks @DaviTostes! Rebased cleanly onto |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review note on head On #116 fixes this in if name.starts_with("ds_read") && name.contains("_d16") {
regs(d, &mut r)?;
}This PR would need the same, plus a test that writes a known value to the destination first and checks the other half survives. Read-only review, nothing built. AI-assisted (Claude Code); the claim above was checked against this head and |
|
Measured on the full retail shader pack (26,503 containers) with
|
catminou4
left a comment
There was a problem hiding this comment.
Merges cleanly with current main (8e79c80); cargo test -p victory-shader --locked on macOS arm64 / rustc 1.98.1 → 71 passed / 0 failed (1 ignored, Windows execution).
Sub-dword LDS lowering is careful: reads extract the byte/half by (addr & mask) * 8 shift with mask or sign extension, _d16/_d16_hi preserve the untouched half via low_half/high_half, and writes do an atomic clear+set (Rmw::And then Rmw::Or) so concurrent lanes writing adjacent bytes in one dword don't race — that's the right call for LDS. The // shortcut: comment honestly states the alignment/bounds assumption. The new lowering test builds a compute shader exercising every read/write form; the GPU execution check is Windows-gated for CI.
4baaee7 to
9fbd7e9
Compare
|
Merged onto Checked with CI's steps (both clippy runs with |
|
Reviewed Found three issues — including a silent 16-bit odd-byte / cross-dword truncation bug — and verified a clean 32-bit fix on top of
Verification (
|
Records what an offline translation of the whole shader pack shows, and it changes how the barrier change should be read: 26,084 of 26,084 programs translate, and not one of them enters widen - no WAVE64-WIDE line with VICTORY_WAVE_WHY=1, offline or in a menus-only run. The change is therefore inert on this pack (it alters no translation) and unproven for Marvisak#101, whose switch must reach programs this machine cannot. Also records two negatives that came out of the traces: the first-run flow touches four title paths and all of them are directories (it never asks to write a file), and XPackage never has a missing slot called, plus that movies.rpf is never handed to Bink.
Lower byte and 16-bit LDS reads and writes in
crates/victory-shader/src/emit/lower.rs:ds_read_u8,ds_read_i8,ds_read_u16,ds_read_i16, and the_d16/_d16_hivariants): load the enclosing 32-bit LDS dword (addr >> 2), shift by the byte/half offset within the dword, zero- or sign-extend to 32 bits, and for_d16/_d16_hipreserve the untouched half of the destination VGPR (vialow_half/ newhigh_half).ds_write_b8,ds_write_b16,ds_write_b8_d16_hi,ds_write_b16_d16_hi): extract the source byte/halfword and update the enclosing 32-bit LDS dword with atomicAnd(clear mask) followed by atomicOr(shifted value) inside the execution guard so concurrent lanes writing adjacent bytes or halves within the same 32-bit dword do not race.Verification
cargo test -p victory-shader— 57/57 passed.rustfmt --edition 2024 --check crates/victory-shader/src/emit/lower.rs— clean.victory translate --validateonshaders.rpf(26,084 programs): cleared all 9an LDS write of bytes or halvesand all 7an LDS read of bytes or halvesfailures, increasing emitted &dxil.dll-validated compute shaders from 1,693 → 1,709 emitted and 1,670 → 1,686 validated (+16/16 validated, 0 new validator errors), including live world compute shadergrass_batch_floating_veg_tess:MSTS_VS_Transform_AddWaterSurfaceDelta_e4f46870_Wrapped.