Repository navigation
Conversation
| halves | ||
| .into_iter() | ||
| .map(|i| { | ||
| let b = if !i.pack2 { |
There was a problem hiding this comment.
Do you really mean row2 == row == "no partner given" in the console format? Just needs clarifying this is pretty hard to read. Maybe a small STE100 comment on a line before the method chaining
| }; | ||
| (i.row, (i.pack2, b)) | ||
| }) | ||
| .collect() |
There was a problem hiding this comment.
Also what about dupes. The old code used the first one and now this uses the last for dupes. Also each duplicate takes up a free row so later input can run out of partners.
| Some(i.row2) | ||
| } else { | ||
| free.iter() | ||
| .position(|&r| r > i.row) |
There was a problem hiding this comment.
You should only use a free row that comes before the next named input row
There was a problem hiding this comment.
Otherwise an earlier input can take a free row that really belongs to a later input. Causes wrong row to be read or fails
|
Tested
No game data used. |
|
Thanks for the review @raffclar! Addressed all three points in
Added unit test coverage for both duplicate rows and the |
…listed signature rows) into the integration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
…d-to-end test fix/packed-half ports upstream Marvisak#176, which integrate/shaders already merged: its lower.rs is identical to the integration's, so that copy is kept. What it adds is the end-to-end test of a pixel program whose packed fp16 input has row2 == row (partner on the unlisted row 6). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
(cherry picked from commit f0e7745)
PR Marvisak#176's half_inputs pairs a packed fp16 input with an unlisted signature row; the zero of 'a 16-bit interpolation of a packed padding half reads zero' stays as the last fallback.
…entrics) By AntoninMichelq. Conflicts and what was kept: - emit/lower.rs (the interpolation's packing): Marvisak#176's `half_inputs` lookup, with the PR's `total` closure after it. - io.rs: Marvisak#179's `Halves` made on demand (`halves.get_or_insert_with(|| Halves::new(p))`), with the PR's `push_pair`; both sides' tests. - emit/mod.rs (the PR's test helper `pixel`): Marvisak#566's per-lane argument of `resource::track` and Marvisak#223's `Target` argument of `emit`; the helper still fails on resources, then I/O, then structure. Co-Authored-By: Claude Fable 5.2 <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. |
(cherry picked from commit f0e7745)
PR Marvisak#176's half_inputs pairs a packed fp16 input with an unlisted signature row; the zero of 'a 16-bit interpolation of a packed padding half reads zero' stays as the last fallback.
…isak#306 Marvisak#333 Marvisak#105 Marvisak#288 Marvisak#343 Marvisak#353 Marvisak#326 Marvisak#259 Marvisak#179 Marvisak#176 Marvisak#226 Marvisak#286) Conflicts: - emit/lower.rs: shader-opcodes and shader-tracking each keyed heap handles by the resource properties (a tuple vs two flattened words); the same key, shader-tracking's form and comment kept. Lowered's test-only fields, test imports and tests of both sides kept. - emit/wave.rs: tests of both sides kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Halfect
left a comment
There was a problem hiding this comment.
CPU-only re-check of f0e7745, merged onto current main ffe310e locally. No GPU execution and no game data used.
Merge state. GitHub shows the PR as dirty; the only conflict with ffe310e is in the test module of emit/lower.rs, where this PR and main both appended tests at the end. Keeping both sides resolves it; production code merges cleanly. The PR adds no resource::track call, so it is not affected by #801.
Verification on the merged tree (Windows, rustc 1.98.1):
packed_half_inputs_pair_unlisted_rows: passed.- CPU-only library suite (skipping
diff_tests,valu_tests,waterfall_tests,stub_pipeline_is_created): 98 passed, 0 failed, 1 ignored. cargo clippy --locked -p victory-shader --lib --tests -- -D warnings: clean.cargo xtask policy: 154 files ok.
@raffclar's three threads are addressed at this head (they show as outdated but were never resolved):
- Readability: the doc comment now states the console's PsInput table repeats
rowinrow2when no distinct partner is named. - Duplicates:
seen.insert(i.row)keeps the first fp16 entry per row, matching the old.find()behaviour, so a duplicate row neither overwrites nor consumes an extra free partner row; the second half of the test covers exactly this. - Free-row stealing: the fallback only takes a free row
rwithi.row < r < next_fp16, so an earlier unpaired input cannot take a row that belongs to a later fp16 input; the test asserts row 0 does not steal row 3 from row 2.
One behavioural check I ran while reading: for a non-pack2 fp16 input with an explicit row2 != row, the old code passed Some(row2) through while this head stores None. This is a no-op in practice: the only consumer of the partner is packed_half, and it is reached only when pack2 is set (the !pack2 arm uses (attribute.row, h / 2) and never reads the partner).
Context for the maintainer's choice between this and #592+#621: the full-pack measurement by @slint6614-dev shows this PR and #592 are result-identical (+117 validated, 6 remaining explicit-row2 stops). Those 6 are the explicit-second-row padding case handled by #621, which is orthogonal to the pairing rule here and can be rebased onto whichever base lands first.
AI-assisted (Kimi); the builds and test runs are from this machine.
f0e7745 to
eb5ac94
Compare
eb5ac94 to
7027809
Compare
|
Verified + integrated. Stack: main Packed fp16 pixel-input pairing merged (runtime kept; a lower.rs test-module conflict resolved to our tests). No regressions; compute emission 493/560. AI use: Qwen Code; local measurements. No game data posted. |
…with the resolution of its conflicts with Marvisak#176 and Marvisak#1293 Marvisak#453 evaluates the halves of an interpolation on their own when i or j is computed (SV_Barycentrics, Interp::Weighted). Marvisak#1293 (in the stack) follows plain v_mov_b32 copies to find the barycentric of a pair, and Marvisak#176 (in the stack) pairs packed 16-bit pixel inputs through half_inputs. The conflicts were in io.rs (the pairing), emit/lower.rs (the interpolation lowering and two spots of the phi and helper code) and emit/shader.rs (the feature bits). See the pull request text for how each was resolved. Marvisak#1293's test interpolation_follows_agreeing_phis_and_rejects_mismatched_or_modified_copies asserted that a computed i (a phi of i and j, a negated copy) is refused; with Marvisak#453 it is supported as a Weighted pair, so those two assertions now expect Weighted halves. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (391 passed, 6 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…with the resolution of its conflicts with Marvisak#176 and Marvisak#1293 Marvisak#453 evaluates the halves of an interpolation on their own when i or j is computed (SV_Barycentrics, Interp::Weighted). Marvisak#1293 (in the stack) follows plain v_mov_b32 copies to find the barycentric of a pair, and Marvisak#176 (in the stack) pairs packed 16-bit pixel inputs through half_inputs. The conflicts were in io.rs (the pairing), emit/lower.rs (the interpolation lowering and two spots of the phi and helper code) and emit/shader.rs (the feature bits). See the pull request text for how each was resolved. Marvisak#1293's test interpolation_follows_agreeing_phis_and_rejects_mismatched_or_modified_copies asserted that a computed i (a phi of i and j, a negated copy) is refused; with Marvisak#453 it is supported as a Weighted pair, so those two assertions now expect Weighted halves. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (391 passed, 6 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A descriptor dword read only as data no longer stops the program: when no instruction uses it, the table's range names its kind (eight dwords is an image, else a structured or raw buffer), and an SMEM buffer load of a descriptor reads it as a raw buffer view. A constant buffer's descriptor read as data stays refused. Pixel inputs of packed 16-bit values now pair each packed row with its unlisted partner row, as the console's input table does, instead of refusing a packed input half no element holds. Ported from Marvisak/VIctory Marvisak#1067, Marvisak#953 and Marvisak#176. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ted signature rows
…ted signature rows
…ith the unlisted signature row A pack2 fp16 pixel input with row2 == row (attr1 row 3 mask 0x3 in the 180 pixel shaders failing with "a packed input half no element holds") is two dwords of halves: dword 0 holds its own half2 row, dword 1 the partner, a 16-bit row of the input signature that no input entry names (row 6 there, the gap between rows 5 and 7), as half_outputs pairs them on the vertex side. interp() took row2 == row as "no partner", so dword 1's halves found no element. Ports half_inputs from upstream PR Marvisak#176 ("pair packed fp16 pixel inputs with unlisted signature rows", by Yaekai, both commits incl. its review follow-up) onto this branch, and adds an end-to-end test that translates a pixel program with that stage data (inputs, input_addr 4866, db_shader_control 80) and a signature with half2 rows 3 and 6, reading attr1.x high, attr1.y and attr1.y high through v_interp_p1ll_f16 / v_interp_p2_f16. Without the port it fails with the same error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
In
crates/victory-shader/src/emit/lower.rs, pixel shader inputs withfp16andpack2set sometimes leavePsInput.row2 == PsInput.roweven when a second 16-bit signature row is packed into the trailing channels of the same hardware attribute (for example,row 0withrow2 == 0packing unlistedrow 1, orrow 3withrow2 == 3packing unlistedrow 6). Previously,interp()treatedrow2 == rowas having no partner (None), causingemit: a packed input half no element holds.This mirrors the existing
half_outputspairing logic for pixel inputs via a newhalf_inputshelper:half && kind == 0) signature rows not named asi.rowby anyPsInputand not explicitly claimed asi.row2(wherei.row2 != i.row).fp16PsInputin row order: usesi.row2wheni.row2 != i.row, and otherwise pairspack2entries with the next available unlisted 16-bit signature row> i.row.packed_half_inputs_pair_unlisted_rowscovering explicitrow2preservation and unlisted-row fallback.Verification
cargo test -p victory-shader— 70/70 passed.rustfmt --edition 2024 --check crates/victory-shader/src/emit/lower.rs— clean.victory translate --validateonshaders.rpf(26,084 programs): reducedemit: a packed input half no element holdsfrom 172 → 6, increasing complete VS/PS shaders from 12,316 → 12,433 emitted (+117) and 12,208 → 12,325dxil.dll-validated (+117, 100% validation pass rate, 0 new validator errors).