Skip to content

Commit 0c3d24e

Browse files
LostBeardclaude
andcommitted
Wasm: expose WasmAccelerator.TotalKernelsCompiled diagnostic
A proxy for the worker-side _modulesById accumulation (each distinct kernel stays cached as a compiled WebAssembly.Module on every persistent worker for the tab's life, never evicted). Pairs with SharedWasmMemoryPages to attribute late-lane process-memory pressure — the lead hypothesis for the ML heavy-test full-sweep timeouts (held ~3 GiB shared memories + unbounded module cache). Diagnostic only; no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 074d826 commit 0c3d24e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

SpawnDev.ILGPU/Wasm/WasmAccelerator.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,16 @@ public static void DisposeSharedWasmMemory()
303303
/// </summary>
304304
private static int _nextKernelId = 0;
305305

306+
/// <summary>
307+
/// Total distinct kernels compiled this session (the monotonic kernelId high-water). DIAGNOSTIC:
308+
/// a proxy for the worker-side <c>_modulesById</c> accumulation — each distinct kernel stays
309+
/// cached as a compiled <c>WebAssembly.Module</c> on every persistent worker for the tab's life
310+
/// (never evicted), so this counts the modules piling up per worker across a long test lane.
311+
/// Pair with <see cref="SharedWasmMemoryPages"/> (held shared-memory high-water) to attribute
312+
/// late-lane process-memory pressure (the heavy-test full-sweep timeout investigation, 2026-06-14).
313+
/// </summary>
314+
public static int TotalKernelsCompiled => _nextKernelId;
315+
306316
/// <summary>
307317
/// Worker-init tracking for one distinct kernel (keyed by its <c>wasmBytes</c> reference in
308318
/// <see cref="_initializedWorkersByKernel"/>). Carries a stable, unique <see cref="KernelId"/>

0 commit comments

Comments
 (0)