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

Open
opened 2026-11-27 21:49:08 +00:00 by AnastasisKon · 5 comments
AnastasisKon commented 2026-11-27 21:49:08 +00:00 (Migrated from github.com)
Contributor

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


What

crates/victory-metal/src/corpus.rs (the victory-metal --corpus sweep) groups converter/pipeline failures by code_name(code) (the IRErrorCode name table) and by normalise(reason) (digits collapsed to N, so hex addresses and counts group together). Both are pure and untested; the --fails output and the per-stage counts rest on their exact behavior.

What this changes

One change, test-only: unit tests in corpus.rs pinning

  • code_name: 0..=19 map to their names, 20 and beyond (incl. u32::MAX) are "Unknown";
  • normalise: each run of digits becomes one N, non-digits pass through, input is truncated to 160 chars, no-digit input is unchanged.

How it was tested

  • cargo test -p victory-metal on an Apple Silicon Mac (the crate is macOS-only; on Windows it builds empty, so CI's workspace run is unaffected)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings
  • cargo xtask policy
  • Game run: not needed (test-only).
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6654985063 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T21:49:08Z. --- ## What `crates/victory-metal/src/corpus.rs` (the `victory-metal --corpus` sweep) groups converter/pipeline failures by `code_name(code)` (the `IRErrorCode` name table) and by `normalise(reason)` (digits collapsed to `N`, so hex addresses and counts group together). Both are pure and untested; the `--fails` output and the per-stage counts rest on their exact behavior. ## What this changes One change, test-only: unit tests in `corpus.rs` pinning - `code_name`: 0..=19 map to their names, 20 and beyond (incl. `u32::MAX`) are `"Unknown"`; - `normalise`: each run of digits becomes one `N`, non-digits pass through, input is truncated to 160 chars, no-digit input is unchanged. ## How it was tested - `cargo test -p victory-metal` on an Apple Silicon Mac (the crate is macOS-only; on Windows it builds empty, so CI's workspace run is unaffected) - `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` - `cargo xtask policy` - Game run: not needed (test-only).
AnastasisKon commented 2026-11-27 21:49:15 +00:00 (Migrated from github.com)
Author
Contributor

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


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7228783550 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7228783550). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T21:49:15Z. --- /claim
github-actions[bot] commented 2026-11-27 21:49:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T21:49:24Z.


Claimed by @AnastasisKon. Open a draft pull request with Refs #473 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7228785895 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7228785895). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T21:49:24Z. --- Claimed by @AnastasisKon. Open a draft pull request with `Refs #473` in its description within 24 hours, or the claim expires.
AnastasisKon commented 2026-11-27 21:51:04 +00:00 (Migrated from github.com)
Author
Contributor

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


Draft PR up: #475 (branch vibe/corpus-helpers-tests-1705ac). Local gates pass: cargo test -p victory-metal (3 new tests), the 4-package test gate, windows clippy, xtask policy.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7228811062 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7228811062). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T21:51:04Z. --- Draft PR up: #475 (branch vibe/corpus-helpers-tests-1705ac). Local gates pass: cargo test -p victory-metal (3 new tests), the 4-package test gate, windows clippy, xtask policy.
AnastasisKon commented 2026-11-28 12:44:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:44:05Z.


/release - done without a PR: on branch vibe/corpus-helpers-tests-1705ac, in my fork's main. It pins corpus.rs' failure-grouping helpers with each_digit_run_collapses_to_one_number, normalise_reads_at_most_160_chars and error_codes_have_their_names_and_beyond_the_table_they_are_unknown.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7239429887 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7239429887). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T12:44:05Z. --- /release - done without a PR: on branch `vibe/corpus-helpers-tests-1705ac`, in my fork's `main`. It pins corpus.rs' failure-grouping helpers with `each_digit_run_collapses_to_one_number`, `normalise_reads_at_most_160_chars` and `error_codes_have_their_names_and_beyond_the_table_they_are_unknown`.
github-actions[bot] commented 2026-11-28 12:44:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T12:44:14Z.


Released. This issue is free to claim.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7239431708 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7239431708). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T12:44:14Z. --- Released. This issue is free to claim.
Sign in to join this conversation.
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#473
No description provided.