Game tests: cover CityHash64 length and block boundaries #2656
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2658"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by XeNS1 on 2026-11-25T17:41:52Z.
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.git diff --check: pass.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.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T17:54:52Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:21:02Z.
Automated triage for the maintainers.
Merge candidate (test only). Adds two tests to
crates/victory-game/src/cityhash.rsthat 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 publiccity.ccat a pinned commit; the inputs are generated in the test, and the empty-input value matches CityHash'sk2constant, which I checked. Production code is unchanged. It merges cleanly; CIcheck: passing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:56:20Z.
Code review and Windows 11 verification at head
119addfe9eaamerged cleanly ontomain(63bcca43c6a0):crates/victory-game/src/cityhash.rs):city64dispatch threshold (0,1..3,4..7,8..16,17..32,33..64,65..68, and multi-64B block boundaries up to4097), plus unaligned subslice offsets (0..8) with0xa5/0x5aguard bytes.cargo xtask policy:191 files ok;cargo clippy --locked -p victory-game --tests -- -D warnings: 0 warningscargo test --locked -p victory-game: 17/17 passed.LGTM.
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T01:16:02Z.
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 base13f91ca).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo 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.matches_reference_at_length_and_block_boundaries,matches_reference_for_binary_state_sizes.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#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_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T15:00:11Z.
Independent verification of head
119addfon 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 --checkagainst 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.Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T18:10:24Z.
Review: APPROVED
Reviewed and verified locally on Windows 11 x64:
cargo test -p victory-game -- --test-threads=1: 17 passed, 0 failed (includingmatches_reference_at_length_and_block_boundariesandmatches_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).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T02:49:27Z.
Review: APPROVED
Reviewed at
119addfe9eaafc87142643090862e4a4e8b7726c— APPROVE.Verification
rustfmt --edition 2024 --check,cargo xtask policy(191 files ok), andcargo clippy -p victory-game --all-targets --all-features -- -D warningsall passed cleanly.0..=4097across every CityHash64 length/64-byte block boundary plus all-0x00and all-0xFF16/24/68-byte inputs) against the CityHash64 v1.1 reference algorithm with zero mismatches, andcheck_subslicescovers unaligned byte offsets0..8with surrounding guard bytes.cargo test -p victory-game --locked cityhash(3/3).Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T12:53:25Z.
I combined your exact
119addfwith #373294b4e7don currentmainin4c66ada. Git merged the single file cleanly and kept both commits as direct parents.All 336 of your reference comparisons passed with inlining, including the eight slice offsets and the 16-, 24-, and 68-byte descriptions used by pipeline prebuild. The whole
victory-gamesuite passed all 17 tests in both debug and optimized Windows builds. Strict all-feature Clippy, formatting, and the asset policy passed.This provides an integration tree if both PRs are picked. Next step is maintainer review. Please retain Git authorship on cherry-pick or rebase. If folding #3732 into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted with OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.