Skip to content

tests: cover snapshot reuse and intermediate staging charges - #1

Open
erickbobd wants to merge 1 commit into
SaymonMaster14:memory/peak-during-world-loadfrom
erickbobd:codex/test472-snapshot-staging
Open

erickbobd wants to merge 1 commit into
SaymonMaster14:memory/peak-during-world-loadfrom
erickbobd:codex/test472-snapshot-staging

Conversation

@erickbobd

Copy link
Copy Markdown

Add two synthetic regression tests for Marvisak/VIctory#472, based directly on f200a2a101e2a61999a8a9f46117231f7fcde71a. The diff adds 75 lines of tests to two files.

  • Snapshot growth: seed a snapshot with spare capacity, change its backing bytes, then grow both ends. Check that previously captured bytes stay intact, the new edges are read, and the existing allocation and capacity are reused. The fixture uses a real mapped D3D12 resource and synthetic bytes.
  • DStorage scheduling: for file and memory inputs, charge the intermediate zlib/BCPack buffer and block a second job until the first releases its staging quota. The fixture runs the scheduler without performing I/O or decompression.

Validation on Windows 11 25H2 26200.9974, RTX 5070 Ti / NVIDIA 617.14, Rust 1.98.1, MSVC x64:

cargo test --locked -p victory-gpu -p victory-hle --features victory-gpu/diagnostics --lib -- --nocapture --test-threads=1

victory-gpu: 46 passed, 1 ignored; victory-hle: 87 passed. cargo xtask policy: 151 files OK.

Mutation controls replaced only each tested function with its actual pre-Marvisak#472 implementation: snapshot reuse failed; staging accounting failed with 16 bytes charged versus 80 required. After restoring the functions, both full library suites passed again with the same counts.

The growth test covers existing spare capacity; it does not claim an in-place allocator reallocation or reduced live-game memory peaks. Synthetic fixtures only. AI-assisted (Codex).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant