Skip to content

Shaders: keep spill loads when the mask clears address bits - #1

Open
MichaelSmithAI wants to merge 1 commit into
dadou000:spill-table-user-datafrom
MichaelSmithAI:fix/spill-pointer-mask
Open

MichaelSmithAI wants to merge 1 commit into
dadou000:spill-table-user-datafrom
MichaelSmithAI:fix/spill-pointer-mask

Conversation

@MichaelSmithAI

Copy link
Copy Markdown

Follow-up for Marvisak#302. The spill-table rewrite assumes a 40-bit address. It preserved the high-word tag after AND with every inline constant from 1 to 64 and every literal up to 0xffff. For example, s1 & 0x7f clears address bit 39. Substituting root-register copies for a load through that address can change the program.

Within the existing set of recognized masks, preserve the tag only when all eight address bits survive. The regression checks a literal mask and an inline constant. The existing positive case still checks the 0xff mask used in the reported world shaders.

Tested on x86-64 Linux, Rust 1.99.1. The new test failed against 815178d before the fix. With the fix, cargo +stable test --offline --locked -p victory-shader --lib passed 59 tests with zero failures and zero ignored. This is a compiler-correctness result on synthetic inputs. Retail shader frequency and rendering impact are unmeasured.

AI assistance: Codex identified the case, wrote the change and ran the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant