GPU: keep the placed-filler bookkeeping out of default builds (#34) #35

Manually merged
github merged 1 commit from github-bot/gh-35 into main 2026-11-26 19:44:32 +00:00 AGit
Owner

@⁠welisonzika14-jpg on GitHub · 2026-11-26 16:08 UTC · original
welisonzika14-jpg:fix/placed-raw-diagnostics → main · +162 −1 · 4 files · 2 commits · merged 2026-11-26 19:29 UTC

Fixes the growth reported in #34.

Problem

PLACED_RAW (crates/victory-gpu/src/resource.rs) keeps every (address, description with filler words 1 and 13) pair for the whole run. On each new pair it scans all variants of that address, while PLACED_TEXTURES is locked. Its only job is the PLACED_TWINS counter, which only diagnostics builds read. Measured on fab5286 with a synthetic load test: 1,000,000 asks with different filler = +1,000,000 entries and about +100 MB private memory; 8,000 variants at one address take about 2 s.

Change

  • The bookkeeping runs only with --features diagnostics, and there it starts over at 16,384 entries.
  • Two #[ignore] load tests (cargo test -p victory-gpu --lib -- --ignored --nocapture): descriptor::tests::placed_view_shapes_load and resource::tests::placed_filler_bookkeeping_load. They print table sizes and the process's private memory (loadprobe.rs).

Tested (RTX 5070, driver 621.24, Windows 11, Rust 1.98.1)

PLACED_RAW after 1M asks private memory time
main fab5286 +1,000,000 +102,196 KiB (2 s for 8,000 variants at one address)
this PR, default build +0 +0 KiB 66 ms
this PR, diagnostics build +576 +824 KiB 1.7 s
  • cargo test -p victory-gpu --lib --locked: 347 passed, 0 failed, 38 ignored (same as fab5286).
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings and the same with --all-features: clean.

Limits

Synthetic, no game files. It does not reproduce the 70-minute session, and I don't know how many filler pairs a real session makes, so this may be only a small part of the 0.4-0.5 GB/min.

Written with AI help (Claude/Kiro); the numbers are from runs on my machine.

**@⁠welisonzika14-jpg** on GitHub · 2026-11-26 16:08 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/35) `welisonzika14-jpg:fix/placed-raw-diagnostics` → `main` · +162 −1 · 4 files · 2 commits · merged 2026-11-26 19:29 UTC Fixes the growth reported in #34. ## Problem `PLACED_RAW` (`crates/victory-gpu/src/resource.rs`) keeps every (address, description with filler words 1 and 13) pair for the whole run. On each new pair it scans all variants of that address, while `PLACED_TEXTURES` is locked. Its only job is the `PLACED_TWINS` counter, which only diagnostics builds read. Measured on `fab5286` with a synthetic load test: 1,000,000 asks with different filler = +1,000,000 entries and about +100 MB private memory; 8,000 variants at one address take about 2 s. ## Change - The bookkeeping runs only with `--features diagnostics`, and there it starts over at 16,384 entries. - Two `#[ignore]` load tests (`cargo test -p victory-gpu --lib -- --ignored --nocapture`): `descriptor::tests::placed_view_shapes_load` and `resource::tests::placed_filler_bookkeeping_load`. They print table sizes and the process's private memory (`loadprobe.rs`). ## Tested (RTX 5070, driver 621.24, Windows 11, Rust 1.98.1) | | `PLACED_RAW` after 1M asks | private memory | time | |---|---|---|---| | `main` `fab5286` | +1,000,000 | +102,196 KiB | (2 s for 8,000 variants at one address) | | this PR, default build | +0 | +0 KiB | 66 ms | | this PR, diagnostics build | +576 | +824 KiB | 1.7 s | - `cargo test -p victory-gpu --lib --locked`: 347 passed, 0 failed, 38 ignored (same as `fab5286`). - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` and the same with `--all-features`: clean. ## Limits Synthetic, no game files. It does not reproduce the 70-minute session, and I don't know how many filler pairs a real session makes, so this may be only a small part of the 0.4-0.5 GB/min. Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
PLACED_RAW kept every (address, description-with-filler) pair for the whole run and scanned all variants of an address on each insert, under the PLACED_TEXTURES lock. It only feeds the PLACED_TWINS counter, which diagnostics builds read. It now runs only with the diagnostics feature, and there it starts over at 16,384 entries.

Adds two #[ignore] load tests (run with --ignored --nocapture) that print the table sizes and the process's private memory: placed view shapes with padding-only changes, and placed-texture asks with different filler words.

Written with AI help (Claude/Kiro).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 16:12:24 +00:00
Author
Owner

@⁠welisonzika14-jpg on GitHub · 2026-11-26 16:51 UTC · original

Related work, for reference: another fork merged a fix for the same growth today, HumanlyDev/HUMAN#7 (merged 2026-11-26 16:42 UTC). It also gates PLACED_RAW / PLACED_TWINS behind feature = "diagnostics", so two forks reached the same fix on their own.

How the two differ:

This PR (#35) HUMAN#7
Default build bookkeeping compiled out bookkeeping compiled out
Cap with diagnostics 16,384 entries, then the set is cleared 65,536 entries
Key per entry unchanged (u64, [u32; 14]) hashed to (u64, u64)
Load test #[ignore] tests in descriptor.rs and resource.rs, numbers in the PR body none in the PR

If you prefer the compact key from HUMAN#7, I can switch to it here. That would cut each entry from 64 bytes to 16, at the cost of a small chance of hash collisions in a diagnostics-only counter.

Written with AI help (Claude/Kiro).

**@⁠welisonzika14-jpg** on GitHub · 2026-11-26 16:51 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/35#issuecomment-7198185789) Related work, for reference: another fork merged a fix for the same growth today, [HumanlyDev/HUMAN#7](https://github.com/HumanlyDev/HUMAN/pull/7) (merged 2026-11-26 16:42 UTC). It also gates `PLACED_RAW` / `PLACED_TWINS` behind `feature = "diagnostics"`, so two forks reached the same fix on their own. How the two differ: | | This PR (#35) | HUMAN#7 | |---|---|---| | Default build | bookkeeping compiled out | bookkeeping compiled out | | Cap with `diagnostics` | 16,384 entries, then the set is cleared | 65,536 entries | | Key per entry | unchanged `(u64, [u32; 14])` | hashed to `(u64, u64)` | | Load test | `#[ignore]` tests in `descriptor.rs` and `resource.rs`, numbers in the PR body | none in the PR | If you prefer the compact key from HUMAN#7, I can switch to it here. That would cut each entry from 64 bytes to 16, at the cost of a small chance of hash collisions in a diagnostics-only counter. Written with AI help (Claude/Kiro).
Author
Owner

@⁠efsebayern on GitHub · 2026-11-26 17:26 UTC · original

I tested #35 on an i7-13700K / RTX 4080 SUPER 16 GB (driver 610.88) / 32 GB RAM, Windows 11 Pro build 26200. Both diag builds used the windowed Series S preset and fresh copies of the same save and warmed shader/pipeline cache. The timed window began after three consecutive log samples with at least 1,000 draws/frame.

Build Timed window Median FPS (per-run samples) Peak process private memory Filler-repeat counter
main fab5286 7m 46s 15.6 (88) 20.43 GiB 0
#35 ceda200 44s 14.05 (8) 19.03 GiB 0
#35 repeat 27s 12.8 (5) 18.72 GiB 0

My runner stopped all three runs after three checks with under 1 GiB of Windows commit headroom. These short and unequal windows do not establish a gameplay performance or memory effect. The filler-repeat counter stayed at zero throughout each run. That counter measures repeats, so it does not establish the size of PLACED_RAW.

I could reproduce the synthetic result independently. With one million filler variants on ceda200, the default build added 0 entries and 0 KiB of private memory. The diagnostics build added 576 entries and 524 KiB in that phase. Both tests passed.

**@⁠efsebayern** on GitHub · 2026-11-26 17:26 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/35#issuecomment-7199018235) I tested #35 on an i7-13700K / RTX 4080 SUPER 16 GB (driver 610.88) / 32 GB RAM, Windows 11 Pro build 26200. Both diag builds used the windowed Series S preset and fresh copies of the same save and warmed shader/pipeline cache. The timed window began after three consecutive log samples with at least 1,000 draws/frame. | Build | Timed window | Median FPS (per-run samples) | Peak process private memory | Filler-repeat counter | | --- | ---: | ---: | ---: | ---: | | main `fab5286` | 7m 46s | 15.6 (88) | 20.43 GiB | 0 | | #35 `ceda200` | 44s | 14.05 (8) | 19.03 GiB | 0 | | #35 repeat | 27s | 12.8 (5) | 18.72 GiB | 0 | My runner stopped all three runs after three checks with under 1 GiB of Windows commit headroom. These short and unequal windows do not establish a gameplay performance or memory effect. The filler-repeat counter stayed at zero throughout each run. That counter measures repeats, so it does not establish the size of `PLACED_RAW`. I could reproduce the synthetic result independently. With one million filler variants on `ceda200`, the default build added 0 entries and 0 KiB of private memory. The diagnostics build added 576 entries and 524 KiB in that phase. Both tests passed.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-26 19:18 UTC · original

The default build skips the filler bookkeeping, and diagnostics stays capped at 16,384 variants. I queued CI for this revision. @⁠welisonzika14-jpg, the exact key makes sense for the diagnostic count. @⁠efsebayern, the synthetic result independently verifies the bound. The gameplay windows were of different lengths, so I am keeping them out of the performance comparison.

**@⁠TaynanGT** on GitHub · 2026-11-26 19:18 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/35#issuecomment-7201447061) The default build skips the filler bookkeeping, and diagnostics stays capped at 16,384 variants. I queued CI for this revision. @⁠welisonzika14-jpg, the exact key makes sense for the diagnostic count. @⁠efsebayern, the synthetic result independently verifies the bound. The gameplay windows were of different lengths, so I am keeping them out of the performance comparison.
github manually merged commit cf2355b6be into main 2026-11-26 19:44:32 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.