Memory: serialize sparse commits and decommits with uploads #233

Open
utkarshxdev wants to merge 1 commit from upstream-pr/236 into main
utkarshxdev commented 2026-11-23 21:43:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by utkarshxdev on 2026-11-23T21:43:51Z.


Serialize sparse CPU page updates with the upload scan. Previously, the scan could read a page while Windows was decommitting it, or a delayed commit record could mark a decommitted page live again.

What is in it

  • Sparse host commits, decommits, and GPU bookkeeping share STATE. A sparse release returns the reservation to the allocator after successful decommit.
  • Fixed-address VirtualAlloc in sparse windows requires MEM_COMMIT and a range within one live reservation. Non-commit calls, including MEM_RESET and MEM_RESET_UNDO, return null and ERROR_INVALID_ADDRESS. This changes the previous host passthrough.
  • CPU-only Windows regression tests cover reset rejection and upload/decommit ordering. The race test checks page accessibility with VirtualQuery before attempting a read.

Tested

  • macOS arm64 cross-check at the revised head: cargo check --locked --target x86_64-pc-windows-msvc --offline --all-targets passed, with one existing deprecation warning.
  • The extracted race test passed on macOS with Win32 memory calls modeled. Moving the host decommit before the lock produced the expected assertion failure.
  • Historical Windows GPU suite on the earlier revision 03d4a86 merged into 0e946cf: Ryzen 5 5600G, RX 7800 XT driver 32.0.32029.2010, Windows 11 26300, Rust 1.100.0 MSVC. cargo test --workspace -- --test-threads=4 reported 655 passed, 0 failed, 40 ignored, and no skips.
  • Windows CI for the revised head requires upstream workflow approval. No test jobs have run.

Regression run

Historical A/B runs from the earlier revision. The display adapter is named in the output. XCL ran on the RX 7800 XT.

Main baseline

xcl-smoke v1
commit: 0e946cfc68244edee1fba6e0425371f687a05ccd
gpu: SudoMaker Virtual Display Adapter
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 1216 (PresentX 1216)
presents per 2 s (last 3): 26 25 26
device removals: 0
crashes: 0
peak commit: 17191 MB

Earlier PR revision merged locally

xcl-smoke v1
commit: 81d72e456615e6d5c98bd433caf8f343d0d1d40e
gpu: SudoMaker Virtual Display Adapter
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 1194 (PresentX 1194)
presents per 2 s (last 3): 18 19 18
device removals: 0
crashes: 0
peak commit: 17173 MB

Not tested

  • The revised head still needs the full suite on a Windows GPU and a fresh xcl-smoke pair. The historical retail run did not exercise the sparse VirtualAlloc commit path.

AI use

  • OpenAI Codex, GPT-6 (exact runtime variant unavailable), implemented the review changes and tests, ran verification, and updated this description.
<!-- greyfinch-sync:ivall/xcl:issue:5461738503 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/236). Originally posted by [utkarshxdev](https://github.com/utkarshxdev) on 2026-11-23T21:43:51Z. --- Serialize sparse CPU page updates with the upload scan. Previously, the scan could read a page while Windows was decommitting it, or a delayed commit record could mark a decommitted page live again. **What is in it** - Sparse host commits, decommits, and GPU bookkeeping share `STATE`. A sparse release returns the reservation to the allocator after successful decommit. - Fixed-address `VirtualAlloc` in sparse windows requires `MEM_COMMIT` and a range within one live reservation. Non-commit calls, including `MEM_RESET` and `MEM_RESET_UNDO`, return null and `ERROR_INVALID_ADDRESS`. This changes the previous host passthrough. - CPU-only Windows regression tests cover reset rejection and upload/decommit ordering. The race test checks page accessibility with `VirtualQuery` before attempting a read. **Tested** - macOS arm64 cross-check at the revised head: `cargo check --locked --target x86_64-pc-windows-msvc --offline --all-targets` passed, with one existing deprecation warning. - The extracted race test passed on macOS with Win32 memory calls modeled. Moving the host decommit before the lock produced the expected assertion failure. - [Historical Windows GPU suite](https://github.com/ivall/xcl/pull/236#issuecomment-7117093360) on the earlier revision `03d4a86` merged into `0e946cf`: Ryzen 5 5600G, RX 7800 XT driver 32.0.32029.2010, Windows 11 26300, Rust 1.100.0 MSVC. `cargo test --workspace -- --test-threads=4` reported 655 passed, 0 failed, 40 ignored, and no skips. - [Windows CI for the revised head](https://github.com/ivall/xcl/actions/runs/45337745707) requires upstream workflow approval. No test jobs have run. **Regression run** Historical A/B runs from the [earlier revision](https://github.com/ivall/xcl/pull/236#issuecomment-7117093360). The display adapter is named in the output. XCL ran on the RX 7800 XT. Main baseline ```text xcl-smoke v1 commit: 0e946cfc68244edee1fba6e0425371f687a05ccd gpu: SudoMaker Virtual Display Adapter title: RetailGame_Dump seconds: 90 exit: 0x0 frames shown: 1216 (PresentX 1216) presents per 2 s (last 3): 26 25 26 device removals: 0 crashes: 0 peak commit: 17191 MB ``` Earlier PR revision merged locally ```text xcl-smoke v1 commit: 81d72e456615e6d5c98bd433caf8f343d0d1d40e gpu: SudoMaker Virtual Display Adapter title: RetailGame_Dump seconds: 90 exit: 0x0 frames shown: 1194 (PresentX 1194) presents per 2 s (last 3): 18 19 18 device removals: 0 crashes: 0 peak commit: 17173 MB ``` **Not tested** - The revised head still needs the full suite on a Windows GPU and a fresh `xcl-smoke` pair. The historical retail run did not exercise the sparse `VirtualAlloc` commit path. **AI use** - OpenAI Codex, GPT-6 (exact runtime variant unavailable), implemented the review changes and tests, ran verification, and updated this description.
srcamarda commented 2026-11-24 07:04:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by srcamarda on 2026-11-23T23:33:15Z.


AMD run of 03d4a86 merged onto main 0e946cf (clean merge), with a retail title, plus a few points from reading the diff.

Tested

  • RX 7800 XT (RDNA3, driver 32.0.32029.2010), Ryzen 5 5600G, 32 GB, Windows 11 26300, Rust 1.100.0 MSVC
  • The PR's tests pass (command_list_slots_include_131_and_132, intro_sparse_reservation_matches_the_observed_request, sparse_commit_rejects_invalid_ranges, the early-commit ones)
  • cargo test --workspace -- --test-threads=4: 655 passed, 0 failed, 40 ignored, no SKIPPED
  • scripts/smoke.ps1, 90 s, six runs of each binary (two batches of three, each starting with a cold translation cache): main 738 / 1 100 / 892 / 1 035 / 1 216 / 1 134 frames, this PR 1 052 / 1 026 / 947 / 948 / 1 194 / 976. Mean ~1 020 for both; no crash or device removal; the same peak commit (~17.2 GB).

What the title does with it

  • #131 and #132 are called once each early in loading. The PR's log lines:
    D3D12.X: ID3D12GraphicsCommandList #132 (0x75d42a70, 0x700000, 0x0, 0x0)
    D3D12.X: ID3D12GraphicsCommandList #131 (0x75d42a70, 0xc3c0, 0x80020000, 0x0)
    
    On main the same calls already reach the guard's stub (ID3D12GraphicsCommandList10::#131 (not on PC), 4 + 3 calls; #132 4 + 1), which returns 0 as well. So on this title the new handlers change nothing but the log, and main does not crash there. Which title or build showed the null-vtable crash?
  • The intro pool reservation never fires here. With XCL_TRACE_MEM, the title's reservations in 90 s are these, and none is 0x1_3800_0000 with plain MEM_RESERVE / PAGE_NOACCESS; every one carries extra flag bits:
    VirtualAlloc(0x0, 0x600000000, flags 0x20402000, protect 0x4)
    VirtualAlloc(0x0, 0x600000000, flags 0x20402000, protect 0x801)
    VirtualAlloc(0x0, 0x49400000, flags 0x20003000, protect 0x22004)
    VirtualAlloc(0x0, 0x89700000, flags 0x20003000, protect 0x2404)
    VirtualAlloc(0x0, 0x23300000, flags 0x20003000, protect 0x22004)
    VirtualAlloc(0x0, 0x25400000, flags 0x20003000, protect 0x22004)
    VirtualAlloc(0x0, 0x185c00000, flags 0x20402000, protect 0x2004)
    
    (plus three 64K-page / coherent-window ones and the placeholders). No VirtualAlloc (sparse commit) line either, so the reworked commit path is not reached by this title. A different build of the game?

Points from reading the diff

  1. An unannounced behaviour change in VirtualAlloc: on main a call on an address in a sparse window without MEM_COMMIT (e.g. MEM_RESET / MEM_RESET_UNDO) goes on to the normal path. With this PR it now fails with ERROR_INVALID_ADDRESS. Intended? It isn't in the description and has no test.
  2. Scope: three unrelated changes (list slots, sparse commit locking, the intro pool). CONTRIBUTING asks for one per PR, and the description needs Tested with the suite counts and the two xcl-smoke blocks for PR checks.

Regression run (gpu: names a virtual display adapter here, but XCL ran on the RX 7800 XT). The second run of the second batch for each:

main:

xcl-smoke v1
commit: 0e946cfc68244edee1fba6e0425371f687a05ccd
gpu: SudoMaker Virtual Display Adapter
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 1216 (PresentX 1216)
presents per 2 s (last 3): 26 25 26
device removals: 0
crashes: 0
peak commit: 17191 MB

this PR merged onto main (local merge commit):

xcl-smoke v1
commit: 22db4c62b726dee1fb28a1ddba55d3a3b67378ec
gpu: SudoMaker Virtual Display Adapter
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 1194 (PresentX 1194)
presents per 2 s (last 3): 18 19 18
device removals: 0
crashes: 0
peak commit: 17173 MB

Not tested

  • The intro pool path and the new sparse commit path (this title reaches neither), whether it hits the new ERROR_INVALID_ADDRESS path, the PR on its own, NVIDIA.

AI use

  • Claude Code with Claude Opus 5.5: ran the tests and the smoke runs, read the logs, the memory trace and the diff, wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7117093360 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/236#issuecomment-7117093360). Originally posted by [srcamarda](https://github.com/srcamarda) on 2026-11-23T23:33:15Z. --- AMD run of `03d4a86` merged onto `main` `0e946cf` (clean merge), with a retail title, plus a few points from reading the diff. **Tested** - RX 7800 XT (RDNA3, driver 32.0.32029.2010), Ryzen 5 5600G, 32 GB, Windows 11 26300, Rust 1.100.0 MSVC - The PR's tests pass (`command_list_slots_include_131_and_132`, `intro_sparse_reservation_matches_the_observed_request`, `sparse_commit_rejects_invalid_ranges`, the early-commit ones) - `cargo test --workspace -- --test-threads=4`: 655 passed, 0 failed, 40 ignored, no `SKIPPED` - `scripts/smoke.ps1`, 90 s, six runs of each binary (two batches of three, each starting with a cold translation cache): `main` 738 / 1 100 / 892 / 1 035 / 1 216 / 1 134 frames, this PR 1 052 / 1 026 / 947 / 948 / 1 194 / 976. Mean ~1 020 for both; no crash or device removal; the same peak commit (~17.2 GB). **What the title does with it** - #131 and #132 are called once each early in loading. The PR's log lines: ``` D3D12.X: ID3D12GraphicsCommandList #132 (0x75d42a70, 0x700000, 0x0, 0x0) D3D12.X: ID3D12GraphicsCommandList #131 (0x75d42a70, 0xc3c0, 0x80020000, 0x0) ``` On `main` the same calls already reach the guard's stub (`ID3D12GraphicsCommandList10::#131 (not on PC)`, 4 + 3 calls; #132 4 + 1), which returns 0 as well. So on this title the new handlers change nothing but the log, and `main` does not crash there. Which title or build showed the null-vtable crash? - **The intro pool reservation never fires here.** With `XCL_TRACE_MEM`, the title's reservations in 90 s are these, and none is `0x1_3800_0000` with plain `MEM_RESERVE` / `PAGE_NOACCESS`; every one carries extra flag bits: ``` VirtualAlloc(0x0, 0x600000000, flags 0x20402000, protect 0x4) VirtualAlloc(0x0, 0x600000000, flags 0x20402000, protect 0x801) VirtualAlloc(0x0, 0x49400000, flags 0x20003000, protect 0x22004) VirtualAlloc(0x0, 0x89700000, flags 0x20003000, protect 0x2404) VirtualAlloc(0x0, 0x23300000, flags 0x20003000, protect 0x22004) VirtualAlloc(0x0, 0x25400000, flags 0x20003000, protect 0x22004) VirtualAlloc(0x0, 0x185c00000, flags 0x20402000, protect 0x2004) ``` (plus three 64K-page / coherent-window ones and the placeholders). No `VirtualAlloc (sparse commit)` line either, so the reworked commit path is not reached by this title. A different build of the game? **Points from reading the diff** 1. **An unannounced behaviour change in `VirtualAlloc`:** on `main` a call on an address in a sparse window without `MEM_COMMIT` (e.g. `MEM_RESET` / `MEM_RESET_UNDO`) goes on to the normal path. With this PR it now fails with `ERROR_INVALID_ADDRESS`. Intended? It isn't in the description and has no test. 2. **Scope:** three unrelated changes (list slots, sparse commit locking, the intro pool). CONTRIBUTING asks for one per PR, and the description needs **Tested** with the suite counts and the two `xcl-smoke` blocks for `PR checks`. **Regression run** (`gpu:` names a virtual display adapter here, but XCL ran on the RX 7800 XT). The second run of the second batch for each: `main`: ``` xcl-smoke v1 commit: 0e946cfc68244edee1fba6e0425371f687a05ccd gpu: SudoMaker Virtual Display Adapter title: RetailGame_Dump seconds: 90 exit: 0x0 frames shown: 1216 (PresentX 1216) presents per 2 s (last 3): 26 25 26 device removals: 0 crashes: 0 peak commit: 17191 MB ``` this PR merged onto `main` (local merge commit): ``` xcl-smoke v1 commit: 22db4c62b726dee1fb28a1ddba55d3a3b67378ec gpu: SudoMaker Virtual Display Adapter title: RetailGame_Dump seconds: 90 exit: 0x0 frames shown: 1194 (PresentX 1194) presents per 2 s (last 3): 18 19 18 device removals: 0 crashes: 0 peak commit: 17173 MB ``` **Not tested** - The intro pool path and the new sparse commit path (this title reaches neither), whether it hits the new `ERROR_INVALID_ADDRESS` path, the PR on its own, NVIDIA. **AI use** - Claude Code with Claude Opus 5.5: ran the tests and the smoke runs, read the logs, the memory trace and the diff, wrote this report.
ryosen0 commented 2026-11-24 07:04:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ryosen0 on 2026-11-23T23:47:39Z.


Test report on our machine with this PR's head (03d4a86) stacked on current main (db1ddb2) + #300 + #294 + #273 + #304: Ryzen 7 9800X3D, RTX 3060 Ti 8 GB (wave32), driver 32.0.16.1742, Windows 11.

XCL_NETWORK=0 XCL_RUN_SECONDS=240 XCL_ACTIVITY=1 xcl run <retail folder>: clean exit at the timer, 3987 frames shown, no crash, no device removal. Intro stretch ~t=60-165 s at 4.9-6.4 fps, then a steady 30.0 fps to the end; the character loading screen is reached. BCPack refusals in the same run: BC5 44, BC7 20 requests (BC1 unpacked). The 41 console-MS-in-AS-slot refusals are unchanged.

The same run without this PR (main + #300 + #294 + #273 + #304, 180 s): the same shape - dip 4.4-8.6 fps at t=44-166 s, 29.9 fps after. So on this hardware the PR neither helped nor hurt the intro pace measurably; the slow stretch looks bounded by something else (we see 6.5 GB local + 4.6 GB non-local video memory on the 8 GB card during it).

Not tested: the command-list slots 131/132 paths in isolation; no unit-test run for this report (run-only data point).

AI use: GPT-6.2 Astra (API model selector) ran the builds and runs and wrote this report; the human contributor watched the screen and reviewed it.

<!-- greyfinch-sync:ivall/xcl:comment:7117370298 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/236#issuecomment-7117370298). Originally posted by [ryosen0](https://github.com/ryosen0) on 2026-11-23T23:47:39Z. --- Test report on our machine with this PR's head (03d4a86) stacked on current main (db1ddb2) + #300 + #294 + #273 + #304: Ryzen 7 9800X3D, RTX 3060 Ti 8 GB (wave32), driver 32.0.16.1742, Windows 11. `XCL_NETWORK=0 XCL_RUN_SECONDS=240 XCL_ACTIVITY=1 xcl run <retail folder>`: clean exit at the timer, 3987 frames shown, no crash, no device removal. Intro stretch ~t=60-165 s at 4.9-6.4 fps, then a steady 30.0 fps to the end; the character loading screen is reached. BCPack refusals in the same run: BC5 44, BC7 20 requests (BC1 unpacked). The 41 console-MS-in-AS-slot refusals are unchanged. The same run without this PR (main + #300 + #294 + #273 + #304, 180 s): the same shape - dip 4.4-8.6 fps at t=44-166 s, 29.9 fps after. So on this hardware the PR neither helped nor hurt the intro pace measurably; the slow stretch looks bounded by something else (we see 6.5 GB local + 4.6 GB non-local video memory on the 8 GB card during it). Not tested: the command-list slots 131/132 paths in isolation; no unit-test run for this report (run-only data point). AI use: GPT-6.2 Astra (API model selector) ran the builds and runs and wrote this report; the human contributor watched the screen and reviewed it.
ivall commented 2026-11-24 07:04:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T23:52:06Z.


Thanks for this, and thanks @srcamarda and @ryosen0 for the runs. Not merged yet - what would get it in, in this PR:

  1. Drop the intro pool reservation. It is keyed to the title's executable name, and fixes here have to model the console for any title, not one game (the repository also does not name the game). srcamarda's memory trace shows the title never makes a plain MEM_RESERVE / PAGE_NOACCESS reservation of 0x1_3800_0000, so the path never runs; if a real reservation needs to be in the sparse windows, the rule should come from what the reservation is (its flags / protection), not who makes it.
  2. The command-list slots #131 / #132: on main these calls already reach the guard's stub, which returns 0 too, so the new handlers only change the log, and no run showed the null-vtable crash they are meant to prevent. Either drop them, or say which title/build crashed there and with what log.
  3. The sparse commit / decommit under STATE.lock() is the part worth having. Two things for it: say in the description (and cover with a test) the behaviour change srcamarda found - VirtualAlloc without MEM_COMMIT (MEM_RESET / MEM_RESET_UNDO) on an address in a sparse window now fails with ERROR_INVALID_ADDRESS instead of taking the normal path; and add a test that shows the race it closes (the upload scan reading a page mid-decommit), failing without the change.

The two A/B runs above found no difference on a retail title either way, so with 1 and 2 gone and 3 tested this is a small, safe change. Please keep Tested (suite counts) and the xcl-smoke pair in the description.

<!-- greyfinch-sync:ivall/xcl:comment:7117448918 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/236#issuecomment-7117448918). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T23:52:06Z. --- Thanks for this, and thanks @srcamarda and @ryosen0 for the runs. Not merged yet - what would get it in, in this PR: 1. **Drop the intro pool reservation.** It is keyed to the title's executable name, and fixes here have to model the console for any title, not one game (the repository also does not name the game). srcamarda's memory trace shows the title never makes a plain `MEM_RESERVE` / `PAGE_NOACCESS` reservation of `0x1_3800_0000`, so the path never runs; if a real reservation needs to be in the sparse windows, the rule should come from what the reservation is (its flags / protection), not who makes it. 2. **The command-list slots #131 / #132:** on `main` these calls already reach the guard's stub, which returns 0 too, so the new handlers only change the log, and no run showed the null-vtable crash they are meant to prevent. Either drop them, or say which title/build crashed there and with what log. 3. **The sparse commit / decommit under `STATE.lock()`** is the part worth having. Two things for it: say in the description (and cover with a test) the behaviour change srcamarda found - `VirtualAlloc` without `MEM_COMMIT` (`MEM_RESET` / `MEM_RESET_UNDO`) on an address in a sparse window now fails with `ERROR_INVALID_ADDRESS` instead of taking the normal path; and add a test that shows the race it closes (the upload scan reading a page mid-decommit), failing without the change. The two A/B runs above found no difference on a retail title either way, so with 1 and 2 gone and 3 tested this is a small, safe change. Please keep **Tested** (suite counts) and the `xcl-smoke` pair in the description.
utkarshxdev commented 2026-11-24 17:06:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by utkarshxdev on 2026-11-24T16:11:38Z.


Hey @ivall, thanks for the guidance!

I've rebased on latest main and addressed all three review items:

  1. Dropped the intro pool reservation entirely.
  2. Dropped command-list slots #131 / #132 to keep this PR strictly focused on memory serialization.
  3. Documented and tested VirtualAlloc non-commit rejection (ERROR_INVALID_ADDRESS), and added the regression test for the upload scan / decommit ordering race.

Branch is clean and rebased with zero conflicts. Ready for workflow approval and review whenever you're free!

<!-- greyfinch-sync:ivall/xcl:comment:7137267825 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/236#issuecomment-7137267825). Originally posted by [utkarshxdev](https://github.com/utkarshxdev) on 2026-11-24T16:11:38Z. --- Hey @ivall, thanks for the guidance! I've rebased on latest `main` and addressed all three review items: 1. **Dropped the intro pool reservation** entirely. 2. **Dropped command-list slots #131 / #132** to keep this PR strictly focused on memory serialization. 3. **Documented and tested `VirtualAlloc` non-commit rejection** (`ERROR_INVALID_ADDRESS`), and added the regression test for the upload scan / decommit ordering race. Branch is clean and rebased with zero conflicts. Ready for workflow approval and review whenever you're free!
DavidM1911 commented 2026-11-25 16:12:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T15:19:42Z.


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7166668535 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/236#issuecomment-7166668535). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T15:19:42Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
brainhay5 commented 2026-12-01 01:53:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T01:53:52Z.


Triage note: this no longer merges with current main (mergeable=false), so it cannot be built or tested as it stands.

Why I am asking rather than just noting it: we have run fifteen mergeable candidates on the retail title on an RTX 5070 Ti, and every one still stops presenting at 50–80 s (device removed, surfacing ~88 s later on the next allocation). The PRs whose descriptions actually match that symptom are the ones that no longer apply — this is one of them. A rebase would make it testable again, and we will run it and report the numbers.

If it has been superseded by merged work, saying so is enough and it can be closed.

AI use: an agent posted this triage note.

<!-- greyfinch-sync:ivall/xcl:comment:7298016245 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/236#issuecomment-7298016245). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-12-01T01:53:52Z. --- Triage note: this no longer merges with current `main` (`mergeable=false`), so it cannot be built or tested as it stands. Why I am asking rather than just noting it: we have run fifteen mergeable candidates on the retail title on an RTX 5070 Ti, and every one still stops presenting at 50–80 s (device removed, surfacing ~88 s later on the next allocation). The PRs whose descriptions actually match that symptom are the ones that no longer apply — this is one of them. A rebase would make it testable again, and we will run it and report the numbers. If it has been superseded by merged work, saying so is enough and it can be closed. *AI use: an agent posted this triage note.*
Foniass commented 2026-12-01 03:01:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:01:24Z.


Triage (#1607) – head 4913af0

No open PR makes the same change. Main has since added its own protection for decommits racing uploads: sparse::decommit(a, n, os) with freeing spans (e0bfb7c1), CPU-view holes during decommit, and coordinated upload plans that recheck pages. The sparse/kernelx code this diff edits has changed a lot.
Problems:

  • kernelx.rs test sparse_virtual_alloc_rejects_out_of_bounds_and_reset calls .expect("sparse UMA"), so it panics on a machine without a GPU or sparse windows (CI). It should skip there.
  • commit_locked / decommit_locked hold the sparse STATE lock across VirtualAlloc / VirtualFree and, for map_pages, across a 64 KiB copy. Every submit's upload scan waits behind that.
    Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7299239634 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/236#issuecomment-7299239634). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:01:24Z. --- **Triage (#1607)** – head 4913af0 No open PR makes the same change. Main has since added its own protection for decommits racing uploads: `sparse::decommit(a, n, os)` with freeing spans (e0bfb7c1), CPU-view holes during decommit, and coordinated upload plans that recheck pages. The sparse/kernelx code this diff edits has changed a lot. Problems: - `kernelx.rs` test `sparse_virtual_alloc_rejects_out_of_bounds_and_reset` calls `.expect("sparse UMA")`, so it panics on a machine without a GPU or sparse windows (CI). It should skip there. - `commit_locked` / `decommit_locked` hold the sparse `STATE` lock across `VirtualAlloc` / `VirtualFree` and, for `map_pages`, across a 64 KiB copy. Every submit's upload scan waits behind that. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/236:upstream-pr/236'
git switch 'upstream-pr/236'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/236'
git switch 'upstream-pr/236'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/236'
git switch 'upstream-pr/236'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/236'
git switch 'main'
git merge --squash 'upstream-pr/236'
git switch 'main'
git merge --ff-only 'upstream-pr/236'
git switch 'main'
git merge 'upstream-pr/236'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!233
No description provided.