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

Open
welisonzika14-jpg wants to merge 1 commit from upstream-pr/35 into main
welisonzika14-jpg commented 2026-11-26 16:12:23 +00:00 (Migrated from git.gtahub.st)

Imported from TaynanGT/Vice-Tay-v2. Originally posted by welisonzika14-jpg on 2026-11-26T16:12:23Z.


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

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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay-v2:issue:14749 --> Imported from [TaynanGT/Vice-Tay-v2](https://git.gtahub.st/github/TaynanGT--Vice-Tay-v2/pulls/35). Originally posted by [welisonzika14-jpg](https://github.com/welisonzika14-jpg) on 2026-11-26T16:12:23Z. --- **@⁠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 · 1 commits · open 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 commented 2026-11-26 16:51:36 +00:00 (Migrated from git.gtahub.st)

Imported from TaynanGT/Vice-Tay-v2. Originally posted by welisonzika14-jpg on 2026-11-26T16:51:36Z.


@⁠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).

<!-- greyfinch-sync:TaynanGT/Vice-Tay-v2:comment:207924 --> Imported from [TaynanGT/Vice-Tay-v2](https://git.gtahub.st/github/TaynanGT--Vice-Tay-v2/pulls/35#issuecomment-207924). Originally posted by [welisonzika14-jpg](https://github.com/welisonzika14-jpg) on 2026-11-26T16:51:36Z. --- **@⁠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).
efsebayern commented 2026-11-26 17:31:24 +00:00 (Migrated from git.gtahub.st)

Imported from TaynanGT/Vice-Tay-v2. Originally posted by efsebayern on 2026-11-26T17:31:24Z.


@⁠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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay-v2:comment:211774 --> Imported from [TaynanGT/Vice-Tay-v2](https://git.gtahub.st/github/TaynanGT--Vice-Tay-v2/pulls/35#issuecomment-211774). Originally posted by [efsebayern](https://github.com/efsebayern) on 2026-11-26T17:31:24Z. --- **@⁠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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/35:upstream-pr/35'
git switch 'upstream-pr/35'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/35'
git switch 'upstream-pr/35'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/35'
git switch 'upstream-pr/35'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/35'
git switch 'main'
git merge --squash 'upstream-pr/35'
git switch 'main'
git merge --ff-only 'upstream-pr/35'
git switch 'main'
git merge 'upstream-pr/35'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
TaynanGT/Vice-Tay-v2!35
No description provided.