test(victory-gpu): pin native::list pure helpers (decode_signed, dxil_bitcode, dedup_stage_elems) #622

Open
github-bot wants to merge 1 commit from github-bot/gh-618 into main AGit
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 15:18 UTC · original
AnastasisKon:vibe/list-helpers-tests-1705ac → main · +91 −0 · 1 files · 1 commits · open

Test-only change: the pure helpers in crates/victory-gpu/src/native/list.rs had no unit tests. 91 lines appended (#[cfg(test)] mod tests at the end of the file); no production code touched.

What the tests pin

  • decode_signed: zigzag decode — even raw maps to raw >> 1, odd raw to -((raw >> 1)), plus a round trip over 0, ±1, ±42, i64::MAX, i64::MIN + 1.
  • dxil_bitcode: a hand-built minimal DXBC container with one DXIL part whose bitcode starts with the BC C0 DE magic is parsed and returns the bitcode past the magic; rejects empty/short containers, a bad DXBC magic, a part count past EOF, a part without the DXIL tag, and bitcode without the BC C0 DE magic.
  • dedup_stage_elems: keeps exactly one element per key — Table by (slot, offset), Pairs and Fixed by kind/index — and because the sort key ends in !writes, the writes: true variant sorts first and is the one kept.

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-gpu --lib native::list::tests — 4 pass (the native module is x86_64-only, so this runs under Rosetta)
  • cargo test --target x86_64-apple-darwin -p victory-gpu -- --test-threads=4 — 453 pass, 0 fail. At the default thread count a few pre-existing Metal GPU tests in native/tests.rs flake on this M1 under Rosetta; the same failures reproduce on a clean upstream/main checkout (issue #552 territory), and each failing test passes in isolation.
  • cargo test -p victory-hle -p victory -p victory-gpu -p xtask (host arm64) — all pass
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings — clean
  • cargo xtask policy — clean
  • Not game-related; no game run needed

Checklist

  • One change, one PR; branch vibe/list-helpers-tests-1705ac from upstream/main, pushed to my fork only
  • No game/GDK files, no dumps/logs in the repo
  • No new diagnostics, no undocumented console-behaviour guesses (test-only)
  • No AI attribution in the diff
**@⁠AnastasisKon** on GitHub · 2026-11-28 15:18 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/618) `AnastasisKon:vibe/list-helpers-tests-1705ac` → `main` · +91 −0 · 1 files · 1 commits · open Test-only change: the pure helpers in `crates/victory-gpu/src/native/list.rs` had no unit tests. 91 lines appended (`#[cfg(test)] mod tests` at the end of the file); no production code touched. ## What the tests pin - `decode_signed`: zigzag decode — even raw maps to `raw >> 1`, odd raw to `-((raw >> 1))`, plus a round trip over `0, ±1, ±42, i64::MAX, i64::MIN + 1`. - `dxil_bitcode`: a hand-built minimal DXBC container with one DXIL part whose bitcode starts with the `BC C0 DE` magic is parsed and returns the bitcode past the magic; rejects empty/short containers, a bad `DXBC` magic, a part count past EOF, a part without the `DXIL` tag, and bitcode without the `BC C0 DE` magic. - `dedup_stage_elems`: keeps exactly one element per key — `Table` by `(slot, offset)`, `Pairs` and `Fixed` by kind/index — and because the sort key ends in `!writes`, the `writes: true` variant sorts first and is the one kept. ## How it was tested - [x] `cargo test --target x86_64-apple-darwin -p victory-gpu --lib native::list::tests` — 4 pass (the `native` module is x86_64-only, so this runs under Rosetta) - [x] `cargo test --target x86_64-apple-darwin -p victory-gpu -- --test-threads=4` — 453 pass, 0 fail. At the default thread count a few pre-existing Metal GPU tests in `native/tests.rs` flake on this M1 under Rosetta; the same failures reproduce on a clean `upstream/main` checkout (issue #552 territory), and each failing test passes in isolation. - [x] `cargo test -p victory-hle -p victory -p victory-gpu -p xtask` (host arm64) — all pass - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` — clean - [x] `cargo xtask policy` — clean - [x] Not game-related; no game run needed ## Checklist - [x] One change, one PR; branch `vibe/list-helpers-tests-1705ac` from `upstream/main`, pushed to my fork only - [x] No game/GDK files, no dumps/logs in the repo - [x] No new diagnostics, no undocumented console-behaviour guesses (test-only) - [x] No AI attribution in the diff
decode_signed zigzag decode (incl. round trip over i64 extremes),
dxil_bitcode DXBC/DXIL container parsing against a hand-built fixture
plus rejection cases (bad magic, part count past EOF, missing DXIL tag,
missing BC magic), and dedup_stage_elems keying with the writes-first
keep. Test-only: 91 lines appended as #[cfg(test)] mod tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 15:20:10 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/622/head:github-bot/gh-618'
git switch 'github-bot/gh-618'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-618'
git switch 'github-bot/gh-618'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-618'
git switch 'github-bot/gh-618'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-618'
git switch 'main'
git merge --squash 'github-bot/gh-618'
git switch 'main'
git merge --ff-only 'github-bot/gh-618'
git switch 'main'
git merge 'github-bot/gh-618'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.