You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validate VICTORY_PAIRS before translating shaders - #1244
The victory translate command silently dropped VICTORY_PAIRS entries that lacked a + separator. It also accepted empty selectors, which matched any shader label.
Validate the comma-separated list before initializing the validator or GPU. Each entry requires two non-empty selectors, and errors identify the invalid entry by position and value. An unset or empty variable still disables pairing. Valid selectors keep their substring matching.
On Windows x64, independent QA built the base and candidate and ran cargo test --locked --offline -p victory (3 passed). With a synthetic input, seven malformed settings exited with code 1 even with --validate --pipelines. An unset or empty variable produced the same output as the base. Parser tests also covered valid pairs, whitespace, and a literal + in the second selector. Pipeline creation was outside the scope of these tests.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 7c27219: cargo test -p victory passes, 3 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).
Merge candidate.parse_pairs in apps/victory/src/translate.rs validates VICTORY_PAIRS before any validator or GPU set-up, and refuses an entry without + or with an empty side. Errors name the position and the text. On main, vs+ became ("vs", ""), and the find closure's l.contains("") then matched the first kept shader, so the pipeline check silently paired the wrong shader. That is the real bug fixed here. An unset or empty variable still means no pairs, and the tests cover valid, whitespace and malformed inputs. Note that a trailing comma (vs+ps,) is now an error too, which is stricter than the skip-malformed convention of the run-time knobs but fine for an offline command. It merges cleanly with main. It overlaps with #673 and #1114 in the test module of the same file, so whichever lands second needs a small rebase.
Validates VICTORY_PAIRS upfront before scanning packs or loading dxil.dll: unset (NotPresent) and "" keep default behavior untouched; invalid UTF-8 (NotUnicode), missing +, empty/whitespace selectors, and trailing/consecutive commas fail immediately with a clear 1-based entry index and value; multi-+ entries split on the first +.
cargo test --locked -p victory: 20/20 passed (16 unit including both new VICTORY_PAIRS parser tests + 4 integration).
LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
victory translatecommand silently droppedVICTORY_PAIRSentries that lacked a+separator. It also accepted empty selectors, which matched any shader label.Validate the comma-separated list before initializing the validator or GPU. Each entry requires two non-empty selectors, and errors identify the invalid entry by position and value. An unset or empty variable still disables pairing. Valid selectors keep their substring matching.
On Windows x64, independent QA built the base and candidate and ran
cargo test --locked --offline -p victory(3 passed). With a synthetic input, seven malformed settings exited with code 1 even with--validate --pipelines. An unset or empty variable produced the same output as the base. Parser tests also covered valid pairs, whitespace, and a literal+in the second selector. Pipeline creation was outside the scope of these tests.AI-assisted.