Low hanging memory leaks and perf issues #229

Open
github-bot wants to merge 12 commits from github-bot/gh-229 into main AGit
Owner

@⁠kekonn on GitHub · 2026-11-26 12:08 UTC · original
kekonn:claude/gifted-clarke-uxuqw8 → main · +279 −48 · 12 files · 12 commits · open

Fixes issues:

**@⁠kekonn** on GitHub · 2026-11-26 12:08 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/229) `kekonn:claude/gifted-clarke-uxuqw8` → `main` · +279 −48 · 12 files · 12 commits · open Fixes issues: - #223 - #233 - #222 - #220 - #218 - #217 - #216 - #215 - #214
The padding words of placed views' descriptions (resource words 1 and 13,
a shader resource view's word 3, a buffer view's word 9) hold the title's
stack junk. Direct3D reads none of them, but each new value made a new
shape: the 4M shapes were full after 30 minutes, and every placed view
after that became a table entry kept for good. Zeroed, new shapes fell
from about 85,000 to 4,500 a minute.

The shape index was a second full copy of every shape; it is now keyed
by the shape's hash, checked against the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e1a1250000,
avatarmanz/VIctory-7900XTX pull request 206 by kripotker)
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
pending_with (the text-entry dialog) boxed its state for the call and
handed the worker thread a bare pointer to it. XAsyncCancel ends the call
and runs its cleanup at once, which freed the box while the dialog's work
still ran: the worker then wrote its bytes into freed memory, and
completed by block address, so a call the title had begun on the same
block since was ended with the dialog's result.

The state is now an Arc shared by the call and the thread, and the thread
completes the call it was started for through complete_call, as
XAsyncSchedule's work already does; a call already over is left alone.
Test: a canceled pending call leaves the next call on its block pending.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
The version is the default cache key's only tie to the translator, and it
stayed 1 while the translator's output changed since 1162d38 (368293e,
4fd34fd, 06fe22a, 7348b80, ad0f9dd, 431cab5, abbbd6b, 7bf91de, 9b7dc77):
a cache made by an earlier build was served as it was (shader_cache
counts those as stale but serves them), so fixes to the translator did
not reach shaders already cached. The same value as avatarmanz's #184.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
The allocation went through XMemVirtualAlloc, which tells victory-gpu of
it, but the free called the host's VirtualFree directly: the guards and
clean marks victory-gpu kept for the range stayed and could be taken for
true of the next memory at that address. Freed now as the title's own
VirtualFree is, after title_memory_freed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
clippy::missing_transmute_annotations failed both CI clippy jobs on the
pinned toolchain. The line is the same as in avatarmanz's #173 and #158.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
Every OpenFile added its file's address and path to WALLS_FILES, which
only VICTORY_WALLS_TRACE reads and nothing empties; now only with the
trace on, and its lookup takes the newest file at an address, since a
freed file object's address comes again. OpenFile and CreateQueue refuse
a null out before opening the file or making the lane: put refused it
only after, and both leaked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
InitializeProviderAsync boxed the provider and put the pointer into the
call's result bytes. When XAsyncBegin refused the block (null, or still
holding a result), finished_with freed the bytes only, and the provider
they named was never freed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
once() kept every (call, destination:port) it had logged, for the whole
run, and scanned the list under one lock on every blocked call; a title
trying new destinations or ports grew it without end. After 256 it logs
once that further ones are not logged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
signature() reserved room for the part's row count before reading a row:
a count of 0xFFFFFFFF asked for some 200 GB, and failing to reserve
aborts the process (no catch_unwind stops it). The reservation is now at
most what the part could hold; the rows past its end are refused as
before. A mask byte above 0xF made cols up to 8, and `1 << cols` where
masks are made overflowed (a panic in debug, mask 0 in release); the
mask keeps its four component bits.
Test: such parts are refused or kept to four components (it aborts
without the change).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
FSSM and FSPX compute programs' thread groups were taken as they came,
and the translator multiplies their sides in 32 bits (numthreads, lanes
per group, one-wave tests): a corrupt group overflowed, a panic in debug
and wrong wave and LDS choices in release. More than the hardware's 1024
threads, a side or in all, is now refused as malformed; zeros pass as
before. A root parameter's user-data index of 248 or more wrapped onto
the merged stages' system SGPRs (index + 8 in a u8); it saturates now and
names no SGPR, and a root descriptor's high half is checked likewise.
Test: thread groups past 1024 are refused, 1024 and zero kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
rectangles() added first + count in 32 bits before widening, so a range
past 4G vertices wrapped and passed the check against the buffer's size;
and the view's SizeInBytes was a 64-bit size cut to 32. The sum is made
in 64 bits now, and a range too large for one view is refused like one
outside its buffer. Only the fallback for rectangle pipelines without
their geometry stage takes this path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
n * PAGE and the range's end were computed unchecked (release builds
wrap), and the page list was read for any n. A range past the address
space now returns null before anything is read or unmapped, as
XMemAllocatePhysicalPages already checks its own count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzkYJn7BAxQj1HWC65
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:10:26 +00:00
Author
Owner

@⁠kekonn on GitHub · 2026-11-26 12:09 UTC · original

Issues filed by hand by me, but all analysis and code generated by Claude Opus 5.5 High with Ultracode on.

Will file remaining issues it found but hasn't tackled yet so some other agent can pick them up.

**@⁠kekonn** on GitHub · 2026-11-26 12:09 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/229#issuecomment-7191643001) Issues filed by hand by me, but all analysis and code generated by Claude Opus 5.5 High with Ultracode on. Will file remaining issues it found but hasn't tackled yet so some other agent can pick them up.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/229/head:github-bot/gh-229'
git switch 'github-bot/gh-229'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-229'
git switch 'github-bot/gh-229'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-229'
git switch 'github-bot/gh-229'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-229'
git switch 'main'
git merge --squash 'github-bot/gh-229'
git switch 'main'
git merge --ff-only 'github-bot/gh-229'
git switch 'main'
git merge 'github-bot/gh-229'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.