kernelx: count XMemVirtualAlloc address-limit violations per run #3353
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3353"
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?
Imported from ivall/xcl. Originally posted by illu0x on 2026-11-29T10:08:52Z.
Diagnostics for
XMemVirtualAllocaddress limits, with no behaviour change. #3173 decodes the flags word (below_4g,address_bits) andlimit(), but placement ignores it. This counts, per run, how many address-limited requests land above their limit — split by below-4 GiB (XMEM_GRAPHICS_32BIT_ADDRESS) and N-bit (XMEM_40BIT_ADDRESS..) — and logs the totals at shutdown.A measured 60 s run of one retail title: 6 of 6 below-4 GiB requests land above their 4 GiB limit (one is placed at ~18 GiB). The actual low-address placement is a follow-up PR; this lands the measurement that justifies it.
Stacked on #3173; only the top commit belongs here. Draft, blocked on #3173: its base is behind
main, so the requiredmain-baseline regression run is deferred until #3173 merges and this rebases ontomain. The run below is against the stack base, as a no-regression check for this commit alone.What is in it
kernelx: count XMemVirtualAlloc address-limit violations per run— the tally, theabove_limitpredicate, and the shutdown report incrates/xcl/src/hle/kernelx.rs; the report call incrates/xcl/src/report.rsTested
stable-x86_64-pc-windows-msvc, debug; AMD RX 6600cargo test -p xcl --lib above_limit_judges_placement_against_the_address_limit: 1 passedmem: XMemVirtualAlloc address limits (placement unchanged): below-4GiB 6/6 above the limit, N-bit 0/0 above the limitRegression run
Deferred (draft): the
main-baseline run comes after #3173 merges and this rebases ontomain. For now, a no-regression check against the stack base (#3173,599bf81a) — amainbaseline today would attributemain's 14-commit drift since #3173 branched to this PR. Both 60 s,XCL_PREPARE=0, same retail title (idb41e6560), AMD RX 6600.Head vs stack base: 1109 / 1035 frames = 107%, peak commit 16685 / 16362 MB = 102%, no device removal, no crash. As expected for a diagnostics-only change (a shutdown log line plus atomic counters on
XMemVirtualAlloc), the difference is within run-to-run noise.Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:02:04Z.
Review (head
bc01bcb8, the top commit only, diff read, not a merge-check; draft, stacked on #3173,PR descriptionred):kernelx.rs~757). So the "6/6" in the description may be inflated. Counting only requests without a fixed address, or only reserves, would keep it to XCL's placements.report::write_final(report.rs~308), which runs from several exits (host.rs~299, ~316, ~319,present.rs~741).dump_fallbacksbehaves the same, so it's at least consistent (unverified how often it happens in one run). There's noreport.jsonfield; the description could say it's a log line.above_limit(~752) repeats theend <= limitcheck intrace_virtual_alloc_flags(~797) instead of sharing it.Fine: the cost is one or two relaxed atomic increments per limited call next to a
VirtualAlloc. The limit is exclusive, the add saturates, and a failed allocation isn't judged. The unit test covers the boundaries, placement is unchanged, and the stack merges cleanly with main.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:51:02Z.
Triage (#1607) – head
bc01bcbStacked on #3173: its first commit is #3173's, and only the top commit (
note_address_limit,report_address_limitsand the shutdown call inreport.rs) belongs here. The shared added lines with #3173 come from that base and are not duplicates. The tally is diagnostics only: it counts address-limited XMemVirtualAlloc requests placed above their limit and does not change placement. No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.