VICTORY_CACHE_CORES: read the processors' cache records to the last one (it was always skipped) #284
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!284
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-284"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@sharan104 on GitHub · 2026-11-26 14:22 UTC · original
sharan104:fix/hosthelp→main· +88 −26 · 1 files · 1 commits · opencores.rsl3_of_sets(used byVICTORY_CACHE_CORES, from #147) walked the recordsGetLogicalProcessorInformationEx(RelationCache)writes, but only while a wholeSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX(80 bytes) still fit. Each cache record states its own, smaller size (56 bytes: the union is as large as its largest member). So:fast_by_cachewould then pick the complex without the stacked cache as the fast one.Fix: a pure function,
largest_caches(&[u8]). It walks the records by their ownSize, stops at a zero or truncated size, and copies each record's own bytes into a zeroed structure before reading it, so nothing outside a record is read.l3_of_setscalls it on the bytes the system returned. The buffer is nowu8, and the copy makes alignment irrelevant.Test:
the_last_cache_record_is_read_toouses synthetic records: two complexes of eight processors, with the stacked 96 MiB L3 listed last. With the old bound the stacked complex came out at 1 MiB (its L2s) and the other complex was picked. Now each complex has its L3, andfast_by_cachepicks processors 8–15. A record cut short and a record of size 0 are also covered. The test fails with the old bound and passed 10 runs out of 10 with the fix.Results:
cargo test -p victory-gpu --locked: 382 passed, 34 ignored.-D warningsadds nothing beyond main's existingwatch.rslint, which #241 fixes.I can't show that Windows ever lists an L3 last on real hardware, so the practical impact may be nil. The out-of-bounds read is fixed either way.
🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.