victory: pin shader::sources (SGD5 records + raw DXBC scan) with unit tests #465
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T21:24:38Z.
What
apps/victory/src/shader.rs'ssources()is the entry point behindvictory shaderand the pre-build: it lists an SGD5 file's packed records (sgd5::records) and every rawDXBCcontainer found by magic whoseContainer::parseaccepts it. It has no tests; the survey/prebuild counts rest on its exact behavior.What this pins
DXBCat an offset is found with that offset, and aDXBCmagic whose container does not parse (truncated size) is skipped;Source::Packed, its label carries offset and name,bytes()returnsNonefor a corrupt (non-deflate) stream, and a well-formed stored-deflate record unpacks to the container bytes;Test-only change: synthetic bytes (hand-built DXBC header, hand-built stored-deflate record), no game data, no new dependencies.
How it was tested
cargo test -p victory(new unit tests inapps/victory/src/shader.rs)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policyImported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T21:24:42Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T21:24:52Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #465in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T21:38:02Z.
Work is up in draft PR #467 (branch vibe/shader-sources-tests-1705ac). Note: a second session of this account opened #468 for the same issue; I closed #468 as a duplicate — #467 covers its cases too.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:43:53Z.
/release - done without a PR (upstream is paused, so none was opened): the work is on branch
vibe/shader-sources-tests-1705acand is in my fork'smain.input_without_shaders_yields_nothinginapps/victory/src/shader.rsnow also checks that the SGD5 magic alone is no record and that a "DXBC" with no header behind it is no container (shader.rs:451-455), andan_sgd5_record_is_listed_and_unpacks_to_its_container(shader.rs:507) covers the record path.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T12:44:03Z.
Released. This issue is free to claim.