metal: pin corpus.rs' failure-grouping helpers (code_name, normalise) with unit tests #475

Merged
AnastasisKon merged 1 commit from upstream-pr/475 into main 2026-11-28 01:35:17 +00:00
AnastasisKon commented 2026-11-27 21:50:45 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T21:50:45Z.


What this changes

Refs #473. One change, test-only: unit tests in crates/victory-metal/src/corpus.rs for the two pure helpers the --corpus sweep groups failures by.

  • code_name: codes 0..=19 map to their IRErrorCode names, 20 and beyond (incl. u32::MAX) are "Unknown".
  • normalise: each run of digits collapses to one N (so hex addresses and counts group together), non-digits pass through, input is capped at 160 chars, digit-only input is "N".

The crate is macOS-only and builds empty elsewhere, so the Windows CI run is unaffected.

How it was tested

  • cargo test -p victory-metal on this Apple Silicon Mac — 3 new corpus::tests pass (42 lib + 12 + 18 others also pass)
  • cargo test -p victory-hle -p victory -p victory-gpu -p xtask — pass (gpu 412, hle 144+2, victory 8+2, xtask 6)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings — pass
  • cargo xtask policy — pass (398 files ok)
  • Ran the game: not needed (test-only)

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md — n/a (the name table order is from Apple's installer header, already commented as such)
  • New diagnostics are behind a VICTORY_* variable and documented — n/a, none added
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5533540305 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/475). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T21:50:45Z. --- ## What this changes Refs #473. One change, test-only: unit tests in `crates/victory-metal/src/corpus.rs` for the two pure helpers the `--corpus` sweep groups failures by. - `code_name`: codes 0..=19 map to their `IRErrorCode` names, 20 and beyond (incl. `u32::MAX`) are `"Unknown"`. - `normalise`: each run of digits collapses to one `N` (so hex addresses and counts group together), non-digits pass through, input is capped at 160 chars, digit-only input is `"N"`. The crate is macOS-only and builds empty elsewhere, so the Windows CI run is unaffected. ## How it was tested - [x] `cargo test -p victory-metal` on this Apple Silicon Mac — 3 new `corpus::tests` pass (42 lib + 12 + 18 others also pass) - [x] `cargo test -p victory-hle -p victory -p victory-gpu -p xtask` — pass (gpu 412, hle 144+2, victory 8+2, xtask 6) - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` — pass - [x] `cargo xtask policy` — pass (398 files ok) - [x] Ran the game: not needed (test-only) ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md — n/a (the name table order is from Apple's installer header, already commented as such) - [x] New diagnostics are behind a `VICTORY_*` variable and documented — n/a, none added
Olima34 commented 2026-11-28 01:35:13 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:35:13Z.

Review: APPROVED


Check report (helping the maintainer clear the queue):

  • CI: check and macos-scripts green on the current head.
  • Read: the whole diff (tests only). It pins code_name and normalise in corpus.rs.
  • Local check: current main (226645f9) merged with this PR and the other test/docs/tools PRs we're landing in this batch (#397 #399 #422 #467 #471 #475 #479 #481 #486 #489 #494 #498 #505 #511). On it, the victory-gpu (arm64), victory-shader, victory-backend, victory-metal and victory tests pass, as do the macOS script tests (rustup-path.sh, run-summary-compare.sh, run-summary.sh --self-test), Windows clippy (-D warnings) and cargo xtask policy. One victory-gpu run in four failed main's own multi_mip_array_and_placed_depth_twins_preserve_all_subresources_and_remirror_immediately. That test also flakes on main alone, so it isn't from this batch.
  • Not checked: no game run (the maintainer asked us to work on GitHub only).

Thanks @AnastasisKon!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6094921328 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/475#pullrequestreview-6094921328). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-28T01:35:13Z. **Review:** APPROVED --- Check report (helping the maintainer clear the queue): - **CI:** `check` and `macos-scripts` green on the current head. - **Read:** the whole diff (tests only). It pins `code_name` and `normalise` in `corpus.rs`. - **Local check:** current main (226645f9) merged with this PR and the other test/docs/tools PRs we're landing in this batch (#397 #399 #422 #467 #471 #475 #479 #481 #486 #489 #494 #498 #505 #511). On it, the `victory-gpu` (arm64), `victory-shader`, `victory-backend`, `victory-metal` and `victory` tests pass, as do the macOS script tests (`rustup-path.sh`, `run-summary-compare.sh`, `run-summary.sh --self-test`), Windows clippy (`-D warnings`) and `cargo xtask policy`. One `victory-gpu` run in four failed main's own `multi_mip_array_and_placed_depth_twins_preserve_all_subresources_and_remirror_immediately`. That test also flakes on main alone, so it isn't from this batch. - **Not checked:** no game run (the maintainer asked us to work on GitHub only). Thanks @AnastasisKon!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS!475
No description provided.