Index outstanding DirectStorage destinations for pager reuse #27

Manually merged
github merged 1 commit from gh-pr/27/head into gh-pr/27/base 2026-12-05 17:22:08 +00:00
Owner

@⁠yyc160 on GitHub · 2026-12-05 15:43 UTC · original
yyc160:perf/storage-destination-index → main · +175 −15 · 3 files · 1 commits · merged 2026-12-05 15:49 UTC

The pager asks whether it can reuse an address range while holding its allocator lock. Each query also took the storage scheduler lock and scanned every lane's unsubmitted, queued and running reads. This keeps a counted range index in the scheduler, from enqueue until completion or cancellation. Handoffs between stages do not remove the range. A running read stays protected after another queue targeting the same address closes.

No changes to queue scheduling, completion ordering, memory budgets, or which blocks can be reused. Physical-page destinations remain outside this address query as before.

Windows x64, release, based on 03efd5b:

  • cargo test --release --locked -p larp-hle --lib modules::dstorage:: -- --test-threads=1 passed, including a two-queue lifecycle regression and a differential overlap test.
  • The ignored compare_chase_sized_stream_batches CPU replay checks every Boolean answer. At depth 4,095, the same 8,192 queries took 16.85/20.63 ms scanning vs 1.78/1.08 ms indexed. At depth 64, scanning was cheaper: 0.37/0.43 ms vs 0.52/0.51 ms. Timings are for queries, not full I/O or game frames.
  • There is a cost to updating the index, particularly for shallow queues. In a separate enqueue/replace/query replay on the local base, at depth 4,095 with one probe per replacement, 8,192 replacements took 13.54-13.92 ms vs 3.20-3.69 ms. No mission FPS improvement is claimed.

AI-assisted by GPT-6.2 Astra.

**@⁠yyc160** on GitHub · 2026-12-05 15:43 UTC · [original](https://github.com/gamingwithhomie/larp/pull/27) `yyc160:perf/storage-destination-index` → `main` · +175 −15 · 3 files · 1 commits · merged 2026-12-05 15:49 UTC The pager asks whether it can reuse an address range while holding its allocator lock. Each query also took the storage scheduler lock and scanned every lane's unsubmitted, queued and running reads. This keeps a counted range index in the scheduler, from enqueue until completion or cancellation. Handoffs between stages do not remove the range. A running read stays protected after another queue targeting the same address closes. No changes to queue scheduling, completion ordering, memory budgets, or which blocks can be reused. Physical-page destinations remain outside this address query as before. Windows x64, release, based on `03efd5b`: - `cargo test --release --locked -p larp-hle --lib modules::dstorage:: -- --test-threads=1` passed, including a two-queue lifecycle regression and a differential overlap test. - The ignored `compare_chase_sized_stream_batches` CPU replay checks every Boolean answer. At depth 4,095, the same 8,192 queries took 16.85/20.63 ms scanning vs 1.78/1.08 ms indexed. At depth 64, scanning was cheaper: 0.37/0.43 ms vs 0.52/0.51 ms. Timings are for queries, not full I/O or game frames. - There is a cost to updating the index, particularly for shallow queues. In a separate enqueue/replace/query replay on the local base, at depth 4,095 with one probe per replacement, 8,192 replacements took 13.54-13.92 ms vs 3.20-3.69 ms. No mission FPS improvement is claimed. AI-assisted by GPT-6.2 Astra.
Keep exact overlap semantics from enqueue through completion, including duplicate ranges and cancellation. The pager no longer walks unrelated requests while holding both allocator and storage scheduler locks. Includes a differential CPU replay and queue lifecycle regression.

AI-assisted by GPT-6.2 Astra.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 17:22:05 +00:00
github manually merged commit 9a25ae90e3 into gh-pr/27/base 2026-12-05 17:22:08 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.