Repository navigation
Conversation
|
I found a reporting self-allocation on head
The This is a synthetic diagnostic-accuracy test, not evidence of a title memory increase or GPU impact. I did not test concurrent mutation, saturation, or a retail run. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the probe; Codex reviewed and prepared this report. |
|
Tested CPU-only on Windows 11 build 26200, Ryzen 7 3800X, and Rust 1.100.0 MSVC debug. I verified that the standalone fixture's
One fixture check passed, with zero failures, ignores, or skips. The native process exited 0. The logging wrapper initially mistook the Not tested Diagnostic formatting or self-allocation, observation during concurrent mutation, other allocator paths, the workspace suite, GPU or retail runs, and performance. AI use T3 Code / Codex ( |
lines() copies the kept allocations into a buffer made with room for the whole table (7 MB), and with the switch on that buffer is itself kept as a large allocation, so the report listed it first as XCL's memory (andrewDoing's probe on xcl-dev#3049: 7 MB with nothing else alive). The copy now skips the buffer's own address; test the_reports_own_buffer_is_not_reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, confirmed and fixed in f9d239b: the snapshot is now copied by AI use: Claude Code (Claude Opus 5.5) wrote the fix and this reply; Prime posted it. |
|
I reran the same standalone native Windows The empty payload now reports 0 MiB / 0 large sites (previously 7 MiB / 1 site). One live 1 MiB payload reports 1 MiB / 1 large site (previously 8 MiB / 2 sites), and the total live lines remain 0 and 1 MiB respectively. This verifies the reported self-allocation case; concurrent mutation, saturation, and retail behavior were not tested. AI use: OpenAI Codex with GPT-6.2 Astra ran the probe; Codex reviewed and prepared this report. |
|
Failed interactive integration result for
Counters-only mode2 ran throughout. Between observations at 12:00:39 and 12:03:19 UTC, process commit rose from 19,977 to 22,880 MiB while Rust live allocations fell from 1,051 to 766 MiB. The increase is outside the Rust live payload count; native/driver/title allocations and allocator-retained capacity remain unseparated. No expensive stack capture or Windows heap walks were enabled. This run does not justify merge approval or a claim that RAM growth/device removal is fixed. Full standalone validation and matching main/head smoke reports remain outstanding. No builds or synthetic GPU tests ran during gameplay. Logs, hashes, counter samples and source/installed-data preservation checks are retained locally. AI use: OpenAI Codex (GPT-6) launched the prepared candidate at the user's request, monitored existing logs and read-only counters, and prepared this report; a separate Codex agent reviewed the log evidence. Optional contributor/test coordination: https://discord.gg/gK3y7WRRY |
The process's commit is one number for the title's memory, the driver's, the shader compiler's and XCL's own. With XCL_HEAP_COUNT=1 (and XCL_ACTIVITY) the log says every 20 s how much XCL's own Rust code holds, by allocation size, and for allocations of 64 KiB and more from which call stacks (offsets in xcl.exe, to symbolize from the .pdb); what the title holds through XMemAllocDefault; what the shader compiler's private heaps hold and have committed; and once a minute what the process heap holds in all. Off, it costs one relaxed load an allocation. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
lines() copies the kept allocations into a buffer made with room for the whole table (7 MB), and with the switch on that buffer is itself kept as a large allocation, so the report listed it first as XCL's memory (andrewDoing's probe on xcl-dev#3049: 7 MB with nothing else alive). The copy now skips the buffer's own address; test the_reports_own_buffer_is_not_reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extend existing PR3049 with XCL_HEAP_COUNT=2 to omit sampled stacks and synchronous Windows heap walks while retaining Rust and title allocation totals. Source-reviewed independently; fixtures added but not executed. This is diagnostic attribution, not a measured memory reduction. Assisted-by: Codex (GPT-6)
e6e6b38 to
a209ad1
Compare
Edited 2026-11-29 (twice): first to "not yet" after Kalmarv's merge-check, then corrected - see my two replies below. How this was run: the suite ran once on the 11 of your PRs that build on this base, merged together (#3047 #3048 #3049 #3091 #3092 #3103 #3104 #3105 #3107 #3123 #3125; a local tree, only #3125 needed a resolution in README and the AI use: Claude Code (Claude Opus 5.5 and Claude Fable 5.2) ran the builds, tests and title runs, reviewed the diff and wrote this; the code points cited were checked against the merged tree. |
|
Independent Windows check of #3049 head
The new Passing test-only candidate diffdiff --git a/crates/xcl/src/heap_count.rs b/crates/xcl/src/heap_count.rs
index be4538e0..aa147eff 100644
--- a/crates/xcl/src/heap_count.rs
+++ b/crates/xcl/src/heap_count.rs
@@ -401,6 +401,44 @@ mod tests {
removed(p, 3 << 20, false);
}
+ #[test]
+ fn counters_only_mode_uses_the_actual_allocator_path() {
+ const CHILD: &str = "XCL_TEST_HEAP_COUNTERS_CHILD";
+ if std::env::var_os(CHILD).is_none() {
+ let output = std::process::Command::new(std::env::current_exe().unwrap())
+ .args(["--exact", "heap_count::tests::counters_only_mode_uses_the_actual_allocator_path", "--nocapture"])
+ .env(CHILD, "1")
+ .env("XCL_HEAP_COUNT", "2")
+ .output().unwrap();
+ assert!(output.status.success(), "{}{}", String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));
+ return;
+ }
+ assert!(on());
+ assert!(!detailed());
+ let layout = Layout::from_size_align(2 << 20, 16).unwrap();
+ let c = class(layout.size());
+ let before_bytes = BYTES[c].load(Ordering::Relaxed);
+ let before_count = COUNT[c].load(Ordering::Relaxed);
+ unsafe {
+ let p = Counting.alloc(layout);
+ assert!(!p.is_null());
+ assert_eq!(BYTES[c].load(Ordering::Relaxed), before_bytes + layout.size());
+ assert_eq!(COUNT[c].load(Ordering::Relaxed), before_count + 1);
+ assert!(locked(|t| t.iter().all(|s| s.ptr != p as usize)));
+ let q = Counting.realloc(p, layout, 3 << 20);
+ assert!(!q.is_null());
+ assert_eq!(BYTES[c].load(Ordering::Relaxed), before_bytes + (3 << 20));
+ assert_eq!(COUNT[c].load(Ordering::Relaxed), before_count + 1);
+ assert!(locked(|t| t.iter().all(|s| s.ptr != q as usize)));
+ let rows = lines(2).unwrap();
+ assert_eq!(rows.len(), 2, "counters-only mode must skip detailed heap walks");
+ drop(rows);
+ Counting.dealloc(q, Layout::from_size_align(3 << 20, 16).unwrap());
+ }
+ assert_eq!(BYTES[c].load(Ordering::Relaxed), before_bytes);
+ assert_eq!(COUNT[c].load(Ordering::Relaxed), before_count);
+ }
+
#[test]
fn a_large_allocation_is_kept_with_its_place_until_it_is_freed() {
// (straight at the table: the switch is the process's, read once)I did not run paired clean-commit title smoke, a long memory-attribution run, AMD or Intel. AI use: Codex (GPT-6.2 Sol) ran the tests and wrote this report; Codex (GPT-6.2 Sol) independently reviewed the counters-only path. |
|
At #3049 head For memory investigations, I suggest reporting this separately as cumulative site insertion misses after 64 probes, including both size groups. The small logging-only diff below also corrects the counter comment. It does not change allocation behavior, the counter, or the memory budget. This is a source review and candidate wording; I did not run a build or synthetic collision test for it. Candidate diagnostic wording diffdiff --git a/crates/xcl/src/heap_count.rs b/crates/xcl/src/heap_count.rs
index be4538e0..124ca26e 100644
--- a/crates/xcl/src/heap_count.rs
+++ b/crates/xcl/src/heap_count.rs
@@ -51,7 +51,7 @@ struct Sites(std::cell::UnsafeCell<[Site; SLOTS]>);
unsafe impl Sync for Sites {}
static SITES: Sites = Sites(std::cell::UnsafeCell::new([Site { ptr: 0, size: 0, frames: [0; FRAMES] }; SLOTS]));
static LOCK: AtomicBool = AtomicBool::new(false);
-/// large allocations the full table had no slot for
+/// cumulative large or sampled-small site insertions that missed within 64 probes
static UNTRACKED: AtomicUsize = AtomicUsize::new(0);
fn class(size: usize) -> usize {
@@ -333,11 +333,10 @@ pub fn lines(top: usize) -> Option<Vec<String>> {
let total: usize = sites.iter().map(|s| s.1 .0).sum();
out.push(if large {
format!(
- "XCL's own heap, large allocations: {} MB in {} from {} places ({} not kept: table full); xcl.exe at {base:#x}",
+ "XCL's own heap, large allocations: {} MB in {} from {} places; xcl.exe at {base:#x}",
total >> 20,
alive.iter().filter(|s| s.size >= LARGE).count(),
- sites.len(),
- UNTRACKED.load(Ordering::Relaxed)
+ sites.len()
)
} else {
format!("XCL's own heap, small allocations: about {} MB, from 1 in {SAMPLE} of them kept ({} from {} places)", total >> 20, sites.iter().map(|s| s.1 .1).sum::<usize>(), sites.len())
@@ -351,6 +350,10 @@ pub fn lines(top: usize) -> Option<Vec<String>> {
}
}
}
+ let missed = UNTRACKED.load(Ordering::Relaxed);
+ if missed != 0 {
+ out.push(format!("XCL's own heap: {missed} cumulative site insertion misses after 64 probes (large and sampled-small allocations)"));
+ }
Some(out)
}
AI use: Codex (GPT-6.2 Sol) checked the source and wrote this report and wording diff; Codex (GPT-6.2 Astra) independently reviewed the counter semantics. |
|
merge-check |
bmjask
left a comment
There was a problem hiding this comment.
Critical review of current head a209ad1f. Diagnostic accuracy issue: the detailed heap report calls UNTRACKED large allocations 'not kept: table full', but the counter is a cumulative insertion miss after a 64-slot probe and can include sampled-small allocations; it remains nonzero after those allocations are freed. This can falsely explain current commit growth. Please label it as cumulative site insertion misses (both size groups), or maintain a true live count. The source analysis includes a 65-address example. This is an instrumentation fix, not a RAM reduction. No local Windows run.
|
@Kalmarv both findings hold at
What I reported about the allocator itself (one relaxed load per allocation when off, the 65,536-slot site table, the spinlock in mode 1) stands. I have edited the verdict line of my merge-check to match. Not tested: a rerun with the heap registered from outside RTX 3080 10 GB (621.40), Ryzen 9 7950X, Windows 11 26200. AI use: Claude Code (Claude Fable 5.2) read the tree and wrote this; read and posted by me. |
|
Correction to my reply above – I checked the wrong tree. I wrote that both of @Kalmarv's findings "hold at
Read in a worktree of AI use: Claude Code (Claude Fable 5.2) found the mistake and wrote this; read and posted by me. |
|
Test report for the counters, from a world run. RTX 5070 Ti 16 GB (617.42), Ryzen 7 9800X3D, 32 GB RAM, this PR's head About 60 s after world entry the counters give 2.47 GB for XCL's own Rust heap in 4.2 M allocations (0.92 GB under 4 KiB, 0.39 GB under 64 KiB, 0.78 GB under 1 MiB) and 0 MB for the title through the process heap. Two other runs of the same binary without this PR put that next to the process heap as a whole:
So on this card about 3 GB of the default process heap in the world belongs to neither XCL's Rust heap nor the title. I have no call stacks for it; the D3D12 runtime and the NVIDIA driver are the callers left, and that part is a guess. It is one run per counter, so read the sizes as rough. If mode 2 could also print the Also seen in the census and not explained by any owner: 788 private write-combined regions of 4 MiB, 3.2 GB in total. AI use: Claude Code (Claude Opus 5.5 ran the runs, wrote the census script and the local patch and read the logs, Claude Fable 5.2 wrote this).
|
|
Review (head a209ad1, diff read, not a merge-check; draft, so not built or run):
Fine: the title counter's add and subtract match ( AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
Test report (not a merge-check: draft, AI-written and posted by Foniass without a human check of each point. |
Process commit combines title storage, XCL allocations, shader compilation and driver memory. This existing PR attributes XCL's Rust heap and title heap allocations. The new
XCL_HEAP_COUNT=2mode keeps byte/count buckets without stack capture, the allocation-site table lock, snapshot buffers or Windows heap walks; mode 1 retains the detailed diagnostics. This is instrumentation, not a RAM or VRAM reduction.Rebased onto main (2026-11-28).
nvidia-devwas merged intomainby #3203, so this PR now targetsmainand its branch was rebased ontomain765b2c5bfff6754e8c9886a73e188a86aca3c64c: heada209ad1f0ea884676a65a16a6769d5a0025a7343(wase6e6b38160258e43b679f7245f43d61c983e7fae). The earlier head was a merge ofnvidia-devinto the branch; that merge commit is gone and the three commits of this PR are replayed onmain. Conflicts were theXCL_ACTIVITYparagraph of README.md and one line ofhost.rs. On the rebased head, on the same RTX 3060 Ti PC, debug profile:cargo check -p xcl --all-targetsexited 0, andcargo test -p xcl --lib -- --test-threads=4 a_large_allocation_is_kept_with_its_place_until_it_is_freed about_one_small_allocation_in_sample_is_kept counters_only_do_not_retain_sites sizes_fall_in_their_class the_reports_own_buffer_is_not_reported heap_countgave 5 passed, 0 failed, 0 ignored, no SKIPPED. The whole suite and the paired title runs have not been rerun on this head; every other result below is from the earlier head. The rebase and its conflict resolution were done with Claude Code.What is in it
XCL_ACTIVITY=1; counts are concurrent samples, not an atomic process snapshot.Tested
Current PR head:
e6e6b38160258e43b679f7245f43d61c983e7fae. Independent source review andgit diff --check.Combined integration
d54d80e1bc9d070cbec4a619abb5f4b89880b2f5compiled withcargo build --locked --release -p xcl --target-dir <isolated-target>: exit 0, 229.200 seconds. This is compilation of the combined candidate, not a build or runtime validation of this standalone PR. Zero tests executed; no GPU checks or smoke run.The earlier description's suite and 60-second smoke results belong to
f9d239bbdc5d2b8019ac58110e5752774a86eb2d; they are historical and do not validate this new head.Regression run
Pending for this revision. No new smoke blocks are claimed.
Not tested
Standalone compilation, new fixture, full suite, gameplay performance and long-run memory behavior at this head. The existing detailed mode retains stack-attribution limitations around concurrent realloc/address reuse and may pause allocating threads during heap walks. The next local candidate selects counters-only mode 2.
AI use
The original contribution and earlier results were prepared with Claude Code (Claude Fable 5.2 and Claude Opus 5.5). Codex (GPT-6) added and independently source-reviewed the counters-only extension, reconciled current NVIDIA, compiled the combined candidate and prepared this update.
Optional contributor/test coordination: https://discord.gg/6B4TykyC4W