Game tests: cover CityHash64 length and block boundaries #2658

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

@⁠XeNS1 on GitHub · 2026-11-25 17:41 UTC · original
XeNS1:codex/cityhash-boundary-vectors-20261125 → main · +82 −0 · 1 files · 1 commits · open

The current CityHash64 regression checks 13 arithmetic-pattern inputs. It misses several length dispatch boundaries and exact 64-byte loop boundaries, so off-by-one changes there can pass the existing test. These hashes identify the compact pipeline states.

Add two tests with 42 independent reference cases: 36 generated inputs at short-input, 64-byte block and longer-loop boundaries, plus zero/0xff inputs at the compact 16/24/68-byte state sizes. Run each case at offsets 0 through 7 with unrelated bytes surrounding the slice (336 comparisons). All expected values come from Google's C++ CityHash64 at f5dc541, compiled locally with g++ -O2; that reference build also passes its upstream city-test.cc suite.

Validation on Linux x86-64 / Rust 1.100.0:

  • cargo test -p victory-game --locked --offline: 17 tests pass.
  • cargo clippy -p victory-game --all-targets --all-features --locked --offline -- -D warnings: passes.
  • rustfmt on the changed file, asset policy (184 files), and git diff --check: pass.
  • Five temporary mutations outside the repository are all detected: 4/17/33-byte boundary mistakes, an extra loop iteration at exact 64-byte multiples, and treating NUL as end of input. The pre-existing reference test passes all five mutations.

Test coverage only; production code is unchanged and no existing algorithm mismatch was found. Full Windows CI on pinned Rust 1.98.1 also passed: workspace Clippy, all-features Clippy, and workspace tests (run). Fixtures are generated in source, with no game files accessed or included and no new dependency.

Coordination claim. AI-assisted: OpenAI Codex.

**@⁠XeNS1** on GitHub · 2026-11-25 17:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/2658) `XeNS1:codex/cityhash-boundary-vectors-20261125` → `main` · +82 −0 · 1 files · 1 commits · open The current CityHash64 regression checks 13 arithmetic-pattern inputs. It misses several length dispatch boundaries and exact 64-byte loop boundaries, so off-by-one changes there can pass the existing test. These hashes identify the compact pipeline states. Add two tests with 42 independent reference cases: 36 generated inputs at short-input, 64-byte block and longer-loop boundaries, plus zero/0xff inputs at the compact 16/24/68-byte state sizes. Run each case at offsets 0 through 7 with unrelated bytes surrounding the slice (336 comparisons). All expected values come from Google's C++ CityHash64 at [`f5dc541`](https://github.com/google/cityhash/blob/f5dc54147fcce12cefd16548c8e760d68ac04226/src/city.cc), compiled locally with g++ -O2; that reference build also passes its upstream city-test.cc suite. Validation on Linux x86-64 / Rust 1.100.0: - `cargo test -p victory-game --locked --offline`: 17 tests pass. - `cargo clippy -p victory-game --all-targets --all-features --locked --offline -- -D warnings`: passes. - rustfmt on the changed file, asset policy (184 files), and `git diff --check`: pass. - Five temporary mutations outside the repository are all detected: 4/17/33-byte boundary mistakes, an extra loop iteration at exact 64-byte multiples, and treating NUL as end of input. The pre-existing reference test passes all five mutations. Test coverage only; production code is unchanged and no existing algorithm mismatch was found. Full Windows CI on pinned Rust 1.98.1 also passed: workspace Clippy, all-features Clippy, and workspace tests ([run](https://github.com/Marvisak/VIctory/actions/runs/45667482618)). Fixtures are generated in source, with no game files accessed or included and no new dependency. [Coordination claim](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633). AI-assisted: OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:11:23 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 17:54 UTC · original

Reviewed: expected values pinned to Google's city.cc at a named commit, covering every algorithm boundary (0–4, 5–8, 9–16, 17–32, 33–64, 65–96/128, block multiples, >4 KiB). Deterministic input generator, no game data. Test-only; CI green.

**@⁠kotekompotek** on GitHub · 2026-11-25 17:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2658#issuecomment-7170175415) Reviewed: expected values pinned to Google's city.cc at a named commit, covering every algorithm boundary (0–4, 5–8, 9–16, 17–32, 33–64, 65–96/128, block multiples, >4 KiB). Deterministic input generator, no game data. Test-only; CI green.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:21 UTC · original

Automated triage for the maintainers.

Merge candidate (test only). Adds two tests to crates/victory-game/src/cityhash.rs that check CityHash64 at every length-dispatch boundary (0-4, 8/9, 16/17, 32/33, 64/65), at exact 64-byte block multiples and longer inputs, and for all-zero/all-0xff inputs at the 16/24/68-byte state sizes. Each case also runs at offsets 0-7 inside unrelated bytes. Expected values come from Google's public city.cc at a pinned commit; the inputs are generated in the test, and the empty-input value matches CityHash's k2 constant, which I checked. Production code is unchanged. It merges cleanly; CI check: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/2658#issuecomment-7176251802) <!-- victory-triage v1 head=119addfe9eaafc87142643090862e4a4e8b7726c verdict=merge-candidate at=2026-11-25T22:21:20Z --> Automated triage for the maintainers. **Merge candidate** (test only). Adds two tests to `crates/victory-game/src/cityhash.rs` that check CityHash64 at every length-dispatch boundary (0-4, 8/9, 16/17, 32/33, 64/65), at exact 64-byte block multiples and longer inputs, and for all-zero/all-0xff inputs at the 16/24/68-byte state sizes. Each case also runs at offsets 0-7 inside unrelated bytes. Expected values come from Google's public `city.cc` at a pinned commit; the inputs are generated in the test, and the empty-input value matches CityHash's `k2` constant, which I checked. Production code is unchanged. It merges cleanly; CI `check`: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 00:56 UTC · original

Code review and Windows 11 verification at head 119addfe9eaa merged cleanly onto main (63bcca43c6a0):

  • Code review (crates/victory-game/src/cityhash.rs):
    • Inputs are generated deterministically from synthetic byte formulas and constant fills (no external data or game hashes) and match reference Google CityHash v1.1 values across every city64 dispatch threshold (0, 1..3, 4..7, 8..16, 17..32, 33..64, 65..68, and multi-64B block boundaries up to 4097), plus unaligned subslice offsets (0..8) with 0xa5/0x5a guard bytes.
  • Verified (Windows 11, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-game --tests -- -D warnings: 0 warnings
    • cargo test --locked -p victory-game: 17/17 passed.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 00:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/2658#issuecomment-7179264618) Code review and Windows 11 verification at head `119addfe9eaa` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review (`crates/victory-game/src/cityhash.rs`)**: - Inputs are generated deterministically from synthetic byte formulas and constant fills (no external data or game hashes) and match reference Google CityHash v1.1 values across every `city64` dispatch threshold (`0`, `1..3`, `4..7`, `8..16`, `17..32`, `33..64`, `65..68`, and multi-64B block boundaries up to `4097`), plus unaligned subslice offsets (`0..8`) with `0xa5`/`0x5a` guard bytes. - **Verified (Windows 11, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy --locked -p victory-game --tests -- -D warnings`: 0 warnings - `cargo test --locked -p victory-game`: **17/17 passed**. LGTM.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 01:16 UTC · original

NVIDIA full-suite run, to go with the reports above by fuzeofficlal, since none of them names a GPU run. Tested exact head 119addf (on its base 13f91ca).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 775 passed, 0 failed, 9 ignored.
  • The new tests ran and passed: matches_reference_at_length_and_block_boundaries, matches_reference_for_binary_state_sizes.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 01:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2658#issuecomment-7179600926) NVIDIA full-suite run, to go with the reports above by fuzeofficlal, since none of them names a GPU run. Tested exact head `119addf` (on its base `13f91ca`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **775 passed, 0 failed, 9 ignored**. - The new tests ran and passed: `matches_reference_at_length_and_block_boundaries`, `matches_reference_for_binary_state_sizes`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-26 15:00 UTC · original

Independent verification of head 119addf on Windows, Rust 1.100.0/MSVC:

  • cargo test --locked -p victory-game --lib -- cityhash::tests::matches_reference_at_length_and_block_boundaries --exact — 1 passed, 0 failed, 16 filtered.
  • git diff --check against merge base — clean.

CPU-only synthetic reference comparison; worktree-local CARGO_TARGET_DIR. AI-assisted (Hy4 flash). GPU/driver N/A. No game data used.

**@⁠cloph-dsp** on GitHub · 2026-11-26 15:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2658#issuecomment-7195639843) Independent verification of head `119addf` on Windows, Rust 1.100.0/MSVC: - `cargo test --locked -p victory-game --lib -- cityhash::tests::matches_reference_at_length_and_block_boundaries --exact` — 1 passed, 0 failed, 16 filtered. - `git diff --check` against merge base — clean. CPU-only synthetic reference comparison; worktree-local `CARGO_TARGET_DIR`. AI-assisted (Hy4 flash). GPU/driver N/A. No game data used.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 18:10 UTC · original · approved these changes

Reviewed and verified locally on Windows 11 x64:

  • cargo test -p victory-game -- --test-threads=1: 17 passed, 0 failed (including matches_reference_at_length_and_block_boundaries and matches_reference_for_binary_state_sizes).
  • cargo clippy -p victory-game --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 18:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/2658#pullrequestreview-6078808624) · **approved these changes** Reviewed and verified locally on Windows 11 x64: - `cargo test -p victory-game -- --test-threads=1`: 17 passed, 0 failed (including `matches_reference_at_length_and_block_boundaries` and `matches_reference_for_binary_state_sizes`). - `cargo clippy -p victory-game --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/2658/head:github-bot/gh-2658'
git switch 'github-bot/gh-2658'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2658'
git switch 'github-bot/gh-2658'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2658'
git switch 'github-bot/gh-2658'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2658'
git switch 'main'
git merge --squash 'github-bot/gh-2658'
git switch 'main'
git merge --ff-only 'github-bot/gh-2658'
git switch 'main'
git merge 'github-bot/gh-2658'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2658
No description provided.