Validate VICTORY_PAIRS before translating shaders #1244
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1244
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1244"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@DoubleD17 on GitHub · 2026-11-24 16:45 UTC · original
DoubleD17:fix/translate-validate-pairs→main· +61 −8 · 1 files · 1 commits · openThe
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.
@Zipettte on GitHub · 2026-11-24 17:59 UTC · original
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 victorypasses, 3 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@Marvisak on GitHub · 2026-11-25 01:19 UTC · original · edited 2026-11-25 06:27 UTC
Automated triage for the maintainers.
Merge candidate.
parse_pairsinapps/victory/src/translate.rsvalidatesVICTORY_PAIRSbefore any validator or GPU set-up, and refuses an entry without+or with an empty side. Errors name the position and the text. Onmain,vs+became("vs", ""), and thefindclosure'sl.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 withmain. It overlaps with #673 and #1114 in the test module of the same file, so whichever lands second needs a small rebase.CI: passing (
check).Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 01:19 UTC · original
Code review and Windows 11 verification at head
fd9659debb77merged cleanly ontomain(63bcca43c6a0):apps/victory/src/translate.rs:155-192):VICTORY_PAIRSupfront before scanning packs or loadingdxil.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 xtask policy:191 files ok;cargo clippy --locked -p victory --tests -- -D warnings: 0 warningscargo test --locked -p victory: 20/20 passed (16 unit including both newVICTORY_PAIRSparser tests + 4 integration).LGTM.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.