Repository navigation
Conversation
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
Tested and verified on Windows 11 x64 (D3D12 WARP + Hardware).
- Tested unit test packed_pixel_inputs_find_their_second_row, validating that row pairing logic correctly identifies the partner 16-bit signature element for packed inputs when
ow2 == row. - Confirms fix resolves the 172 blocked shaders in shaders.rpf that emitted � packed input half no element holds.
- cargo test -p victory-shader: 70 passed, 0 failed.
- cargo clippy -p victory-shader --lib -- -D warnings: 0 warnings.
- cargo xtask policy: 151 files clean.
|
I have the same local v1.0.2.1 shader archive and will investigate the 6 remaining explicit- If the cause is separable, I’ll add a focused synthetic regression test and open a small follow-up PR stacked on this head. I’ll report counts and metadata only, without shader contents or extracted data. AI-assisted (Kimi). |
|
Opened the follow-up as #621, stacked on this head: #621 The explicit- |
|
Hardware readback on
The results matched on the RTX 5090 (32.0.16.1656) and Radeon iGPU (32.0.21042.62). This covers the inferred pairing and the explicit control for this constant-varying fixture. The explicit padding cases are tracked in #621. The same fixture also passed on #176 at |
|
Tested offline against main
AI-assisted. |
Pixel inputs packing two 16-bit rows per dword (pack2) whose metadata leaves the second row out (row2 = row) had no second row, so reading its halves failed: "a packed input half no element holds". The second row is now found as the output side finds it (half_outputs): the next 16-bit row of the input signature that no input entry names, taken in row order, after the rows the metadata does give. translate --validate on shaders.rpf: vertex/pixel 12172 -> 12289 validated; 6 programs whose metadata names a second row still stop there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Measured on the full retail shader pack (26,503 containers) with
#621 clears all 172 (+123 validated pixel programs); #176 and #592 give identical results (+117, 6 left). CS and MS unchanged in all three. |
7139712 to
35bf153
Compare
|
Heads-up on the stack: #621 is stacked on this PR — its body says "Stacked on #592 at 35bf153; only 7e5c7c8 is new here", and since its base is I reviewed and approved #621 after rebasing it onto current main locally: merges cleanly, Also noting #176 (Yaekai) is an independent implementation of the same root fix (pairing |
|
Independent check on Linux, merged onto current |
|
Measured on Linux (RX 9070 XT, RADV/Mesa 26.3.1, GE-Proton11-14, vkd3d-proton master), head 35bf153 merged onto our tree:
|
|
An independent count of what this blocks, measured on main
What the code path allows, reading
Routes 2 and 3 are what #176, #592 and #621 describe, and I read #176 and #592 as the same pairing fix described twice ( One thing that may help whoever implements #621: this same function already reads a missing half as zero for a flat input. In the If any of #176, #592 or #621 lands, I can run the same census before and after on a clean worktree and report which families unlock and how many, the way I did for #878. Written with an AI assistant. |
|
Following up on my count with a probe that says which missing-half case each read actually hits. The probe is local and small: a guarded First, a correction to my own note. The 167th line is not a wrapped report. The census ends with one line per reason, shaped With the probe, the 166 programs make 1048 failing half-reads, and they land on exactly two of the four routes I listed:
Nothing landed on the other two routes. No read asked for a half in the padding of its own row ( Two limits, stated plainly. These are reads, not programs: a program makes several such reads, and the lowering has no program name in scope, so I cannot say how the 166 split between the two cases or which families sit on which side. And this is a pre-fix number. My reading of the three changes is that once this PR lands, the 220 should disappear and the 828 should be what is left standing - which would make the remaining question exactly #621's. I can measure that on the merged result the same way I did for #878 and #877, on a clean worktree, before and after. Written with an AI assistant. |
Halfect
left a comment
There was a problem hiding this comment.
Independent verification of 35bf153 merged onto current main ffe310e (clean merge; only crates/victory-shader/src/emit/lower.rs, +87/−1), Windows 11, rustc 1.98.1 (x86_64-pc-windows-msvc):
cargo test --locked -p victory-shader --lib, CPU-only suite skippingdiff_tests,valu_tests,waterfall_tests,stub_pipeline_is_created: 98 passed, 0 failed, 1 ignored —packed_pixel_inputs_find_their_second_rowincluded.cargo clippy --locked -p victory-shader --lib --tests -- -D warnings: clean.cargo xtask policy: 154 files ok.
Code read on the merged tree: half_input_partners mirrors the output-side half_outputs convention — the next 16-bit signature row that no input entry names and no explicit row2 already claims, in row order — and the partner is consulted only under pack2 && row2 == row, so flat inputs and explicitly paired rows are untouched. The test's assignments (0→1, 3→4, explicit 5→6 left alone) match that rule, and @fiestorra's probe (220 partner-absent reads vs 828 named-but-short) lines up with what this PR covers versus what remains for #621.
One observation, not blocking: the partner map is rebuilt per packed-half read. Signatures are small, so the cost is negligible, and caching it would complicate lifetimes for no measurable gain.
Disclosure: my #621 is stacked on this head, so I have an interest in it landing; this is still an independent check of the merge with current main, which the existing runs don't cover (Linux, macOS, or the older 7139712 head).
CPU-only; no GPU run, no game data. AI-assisted (Kimi).
Pixel inputs packing two 16-bit rows per dword (pack2) whose metadata leaves the second row out (row2 = row) had no second row, so reading its halves failed: "a packed input half no element holds". The second row is now found as the output side finds it (half_outputs): the next 16-bit row of the input signature that no input entry names, taken in row order, after the rows the metadata does give. XTP adaptation: the hunks of emit/lower.rs went to emit/lower/input.rs (S0b), the upstream unit test with them. Added: an end-to-end test of a pixel program reading channel 1 of the second row through v_interp_p1ll_f16/v_interp_p2_f16, translated and validated, and still refused past that row's halves. Survey (shaders.rpf, any host, every translation validated; this commit alone): see the next commit's message for the pair with #621. Ported from Marvisak/VIctory#592 (head 35bf1530542f9a463a233d14394e8c6734ae0958) by SAitken91 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#592's second-row inference is already here (a823dfb, half_inputs), so its half_input_partners is left out. #621's packed_input_half is ported onto half_inputs: when the metadata names the packed row's partner, a 16-bit read of a half no element holds is the packing's padding, read as 0.0; with an inferred partner it still refuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Automated triage for the maintainers. Closing because this change is already in Second rows of packed 16-bit pixel inputs: superseded by main's first-fit packing rule (packed_half in emit/lower.rs, 13091f6), which needs no partner row. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Shaders: Honor fetch-inactive and bound-control on masked row permutations
…ts (the merge defined it twice)
Pixel inputs that pack two 16-bit rows per dword (
pack2) failed when their metadata leaves the second row out (row2=row). With no second row, reading any of its halves failed with "a packed input half no element holds". That blocked 172 programs in shaders.rpf, mostly ped and mirror-reflection pixel shaders.Change
half_input_partners. It finds the missing second row the way the output side already does (half_outputs): the next 16-bit row of the input signature that no input entry names, taken in row order. Rows the metadata does give are taken first, so they aren't handed out twice.pack2is set androw2=row. An explicitrow2is used as before.Why not just read 0
I tried that first, and it would have validated more programs. A diagnostic showed the failing reads were halves 4–7 with a 4-channel first row, which is the second row's data, not padding. Reading 0 would have hidden real values, so I didn't do it.
Results
victory translate --validate shaders.rpf: vertex/pixel validated 12172 → 12289. 6 programs whose metadata does name a second row still stop at this error. That looks like a separate case, and it's left as is.Testing
cargo test -p victory-shader: 70 passed, including the newpacked_pixel_inputs_find_their_second_row. Clippy and rustfmt are clean.This is independent of #539, #554, #563, #565, #569 and #571.
Written with the help of Claude (AI).
🤖 Generated with Claude Code