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

Open
opened 2026-11-27 21:54:10 +00:00 by github-bot · 5 comments
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 21:49 UTC · original

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** on GitHub · 2026-11-27 21:49 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473) ## 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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:54:11 +00:00
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 21:49 UTC · original

/claim

**@⁠AnastasisKon** on GitHub · 2026-11-27 21:49 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7228783550) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 21:49 UTC · original

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

**@⁠github-actions[bot]** on GitHub · 2026-11-27 21:49 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7228785895) Claimed by @⁠AnastasisKon. Open a draft pull request with `Refs #473` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 21:51 UTC · original

Draft PR up: #479 (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** on GitHub · 2026-11-27 21:51 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7228811062) Draft PR up: #479 (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.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 12:44 UTC · original

/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.

**@⁠AnastasisKon** on GitHub · 2026-11-28 12:44 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7239429887) /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`.
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 12:44 UTC · original

Released. This issue is free to claim.

**@⁠github-actions[bot]** on GitHub · 2026-11-28 12:44 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/473#issuecomment-7239431708) Released. This issue is free to claim.
This discussion has been locked. Commenting is limited to contributors.
No description provided.