Skip to content

Placed-view leak fix from foxhound behind VICTORY_PLACED_NORMAL (off) - #15

Open
oceansde012 wants to merge 1 commit into
mainfrom
claude/project-thread-gufrlv
Open

oceansde012 wants to merge 1 commit into
mainfrom
claude/project-thread-gufrlv

Conversation

@oceansde012

Copy link
Copy Markdown
Owner

Requested by Vlad · project thread

What

Port of foxhound's placed-view normalisation (readmet3xt-lab/foxhound 3d52ac8, GPL-3.0-or-later). The title leaves stack garbage in unused words of placed SRV/UAV descriptions, so almost every placed view becomes a new shape: per foxhound, after ~20 min the 4,194,304-shape table fills, then 5.6 M table entries are never freed (+3.3 GB) and frame time doubles. f4b48ad records the raw words, so it has the same leak.

  • normalize_placed_words: clears padding and unused union words, folds a buffer view's first element into its address (logic unchanged from foxhound).
  • normal_placed: gate, off by default; VICTORY_PLACED_NORMAL=1 turns it on (foxhound has it on by default).
  • 4 unit tests of the pure function.

Code written by DeepSeek, reviewed by Claude against the source line by line.

Checks

  • cargo check --target x86_64-pc-windows-msvc -p victory-gpu --tests passes (cloud, clang-cl).
  • Not run in game (testing mode). For the PC batch: base vs VICTORY_PLACED_NORMAL=1, run of 20 min or longer, watch RAM commit, frame time over time, picture vs base run1.

Notes

  • Nit: the doc of normalize_placed_words still carries foxhound's line "VICTORY_PLACED_NORMAL=0: kept as ... as before"; the gate's doc states the real default (off). To be fixed in the next code round.
  • Full foxhound review: project file reports/foxhound-2026-11-28.md.

Generated by Claude Code

The title leaves stack garbage in padding and unused union words of
placed SRV/UAV descriptions, so nearly every placed view becomes a new
shape; after ~20 minutes the shape table fills and millions of table
entries are never freed (+3.3 GB, frame time doubled, per foxhound).
With VICTORY_PLACED_NORMAL=1 those words are cleared and a buffer view's
first element is folded into its address. Off by default: f4b48ad
behaviour unchanged.

Ported from readmet3xt-lab/foxhound 3d52ac8 (GPL-3.0-or-later),
code written by DeepSeek, reviewed by Claude.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLuVRmo5FHYXYy7aPFnJ3Q

Copy link
Copy Markdown
Owner Author

CI check fails on a file this PR does not touch: crates/victory-formats/src/texture.rs:1346 hits clippy::precedence (i * 7 >> 3) under -D warnings. The same code is on main (f4b48ad), and with Rust 1.98 the lint fails every branch built from it. PR #12 already carries the fix ("Parenthesize a shift in a texture test for clippy::precedence"). Once #12 lands, merging main into this branch clears the failure. The changed crate (victory-gpu) passes cargo check --target x86_64-pc-windows-msvc --tests.


Generated by Claude Code

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.

2 participants