d3d12 gpu: VirtualQuery walks the write watch stood behind while walking (D3D12-HWRT-REGION-WALK-STALLS) #3410

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u  "d3d12-hwrt-region-walk-stalls:Rockcabbage-d3d12-hwrt-region-walk-stalls"
git switch "Rockcabbage-d3d12-hwrt-region-walk-stalls"
Open
leonida/mandy
Rockcabbage wants to merge 5 commits from Rockcabbage/mandy:d3d12-hwrt-region-walk-stalls into main

This branch is out-of-date with the base branch

Conversation
Reviewers 0 approvals
  • No reviewers
Details
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'd3d12-hwrt-region-walk-stalls:Rockcabbage-d3d12-hwrt-region-walk-stalls'
git switch 'Rockcabbage-d3d12-hwrt-region-walk-stalls'
First-time contributor

Claimed in the coordination issue as: D3D12-HWRT-REGION-WALK-STALLS (claimed in #2570, done: ... -> #3113 there; #3312 continues that issue)

This carries on #3113. That pull request came over in the migration with its author shown as a placeholder, so its
branch cannot be updated from here. Its head (5ce6907bd) has the same change as this one, but it is based on the main
from before the move. This branch is the same change as one commit on current main, with one follow-up from a
second review (below). If this one is taken, #3113 can be closed in its favour.

What and why

Two callers of VirtualQuery held up frames while walking with hardware ray tracing on. VirtualQuery answers with
the length of the run of pages in the same state. To find it, it walks the page tables to the run's end; this is what
texture::by_query already says of the textures' pass. In the title's pools that is 21-36 ms a question, and the
submitting thread's GetWriteWatch stands behind the walk for as long.

  • hwrt.rs: readable_len / title_readable are asked for each geometry of a batch of bottom-level builds. They
    walked twice in a row, 47-48 ms for the batch. They now ask page by page through texture::readable_bytes
    (QueryWorkingSetEx, 256 pages a call). LEONIDA_HW_RT_REGION_QUERY=1 asks VirtualQuery as before, and
    LEONIDA_AB can switch it. texture::readable now leaves a working-set page that is PAGE_NOACCESS or a guard to
    the one-byte read, so the page-wise answer refuses what the walk refused.
  • copystat.rs (diagnostics only): the frame meter's five-second lines asked VirtualQuery only for the kind of
    memory of the ten ranges most copied from, one walk of 24-28 ms each time. They now ask about the one page
    (texture::shared, compiled with diagnostics or tests only). The line says shareable memory /
    private or untouched memory where it gave the type's number.
  • d3d12/docs/findings.md: a section with the measurements below. d3d12/docs/switches.md is regenerated with
    tools/d3d12_switches.py.

A committed page that is not resident is read one byte to learn whether it is there, so it is faulted in. The BLAS
build reads those bytes right after the question, so that fault is paid either way. texture::committed makes the
same trade for the textures' pass.

Measured

These measurements were taken before the move, on the earlier head (the same diff on the main of that time). They were
not taken again on this base.

The setup:

  • RTX 4090, i9-13900K, Windows 11, Series X profile, 2560x1440, -HardwareRT -NoFrameGen, diag build.
  • A scripted walk of 110 s with camera turns (LEONIDA_KEYS).
  • A timeline of 12 frames every 3 s (LEONIDA_TIMELINE).
  • The switch flipped by turns of 5 s inside the run (LEONIDA_AB=5,LEONIDA_HW_RT_REGION_QUERY), over two runs.
timelines holding a walk of 20 ms or more from hwrt.rs
VirtualQuery (switch on) 38 11
page by page (default now) 33 0
  • One timeline straddled a turn of the switch and is left out.
  • In the timelines that hold a walk, the submitting thread's longest GetWriteWatch is 22-47 ms (0.2-2 ms in the
    others), and the frames are 50-65 ms among frames of 40-50.
  • The meter's walk was in 4 of 36 timelines of the run before the change and in 0 of 36 of the run after.
  • What this does not change: between the stalls the frames are the card's (37-45 ms of work a frame here), so the median
    while walking does not move. This removes the frames that stood out above it.
  • The pictures of the runs before and after are right. They were looked at, not compared pixel by pixel, because the
    walk does not repeat exactly.
  • A later stability run on the earlier head: 440 s, 0 device lost, 0 crashes, and a median frame of 48.8 ms over
    7,510 frames in the world.

Tested

On this branch, rebuilt on main 312d88d1d:

  • cargo check -p leonida-gpu, with and without --features diagnostics: no warnings on this change's lines. The
    diagnostics build has one warning, in book.rs; it is on main too.
  • cargo test -p leonida-gpu --lib --locked: 731 passed, 0 failed, 59 ignored. With --features diagnostics: 812 passed, 0 failed, 59 ignored.
  • New tests:
    • hwrt::tests::title_memory_is_asked_about_page_by_page covers committed, read-only, closed and uncommitted pages,
      a range across them, a wrapping length, and that VirtualQuery was not asked.
    • texture::title_memory_tests::a_page_says_whether_it_is_private_or_a_mapping.
  • Red and green, by reverting the source by hand:
    • With readable_len sent back to the walk, the first test fails at "VirtualQuery asked" (9 walks against 0).
    • With texture::shared answering as the old code could not (always Some(false)), the second test fails on the
      mapping (Some(false) against Some(true)).
    • Restored, both pass.
    • On main neither test builds, because the functions and the count of walks are new.
  • A test cannot reach the protection bits that texture::readable now checks: Windows takes a page out of the
    working set as it closes it, so the one-byte read refuses that page with or without the check. Reverting the check
    leaves the test green. It is kept as a guard, and the test's comment says so.
  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: passes.
  • python -I tests/test_d3d12_switches.py: 22 OK.
  • python -I scripts/check_no_game_data.py on the changed files: exit 0.

GPUs tested: NVIDIA GeForce RTX 4090, driver 621.24, Windows 11 (CPU: Intel i9-13900K)

AI-assisted: yes. Claude Code; Claude Fable 5.2 directing, Claude Opus 5.5 writing and reviewing.

  • Before the move, a separate read-only reviewer agent (Claude Opus) audited the diff. Its findings are in this
    commit: a third walk left on the default path, the protection of working-set pages, a dead-code warning, the
    shared count of walks, and timings.
  • On this base, a second review pass by Claude Opus 5.5 found that the test's comment claimed the protection bits
    were exercised. That comment is corrected in the follow-up commit.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

Claimed in the coordination issue as: `D3D12-HWRT-REGION-WALK-STALLS` (claimed in #2570, `done: ... -> #3113` there; #3312 continues that issue) This carries on #3113. That pull request came over in the migration with its author shown as a placeholder, so its branch cannot be updated from here. Its head (5ce6907bd) has the same change as this one, but it is based on the main from before the move. This branch is the same change as one commit on current `main`, with one follow-up from a second review (below). If this one is taken, #3113 can be closed in its favour. - Base: `main` at 312d88d1d. - Head: `d3d12-hwrt-region-walk-stalls` at 3889530c7. ### What and why Two callers of `VirtualQuery` held up frames while walking with hardware ray tracing on. `VirtualQuery` answers with the length of the run of pages in the same state. To find it, it walks the page tables to the run's end; this is what `texture::by_query` already says of the textures' pass. In the title's pools that is 21-36 ms a question, and the submitting thread's `GetWriteWatch` stands behind the walk for as long. - `hwrt.rs`: `readable_len` / `title_readable` are asked for each geometry of a batch of bottom-level builds. They walked twice in a row, 47-48 ms for the batch. They now ask page by page through `texture::readable_bytes` (`QueryWorkingSetEx`, 256 pages a call). `LEONIDA_HW_RT_REGION_QUERY=1` asks `VirtualQuery` as before, and `LEONIDA_AB` can switch it. `texture::readable` now leaves a working-set page that is `PAGE_NOACCESS` or a guard to the one-byte read, so the page-wise answer refuses what the walk refused. - `copystat.rs` (diagnostics only): the frame meter's five-second lines asked `VirtualQuery` only for the kind of memory of the ten ranges most copied from, one walk of 24-28 ms each time. They now ask about the one page (`texture::shared`, compiled with diagnostics or tests only). The line says `shareable memory` / `private or untouched memory` where it gave the type's number. - `d3d12/docs/findings.md`: a section with the measurements below. `d3d12/docs/switches.md` is regenerated with `tools/d3d12_switches.py`. A committed page that is not resident is read one byte to learn whether it is there, so it is faulted in. The BLAS build reads those bytes right after the question, so that fault is paid either way. `texture::committed` makes the same trade for the textures' pass. ### Measured These measurements were taken before the move, on the earlier head (the same diff on the main of that time). They were not taken again on this base. The setup: - RTX 4090, i9-13900K, Windows 11, Series X profile, 2560x1440, `-HardwareRT -NoFrameGen`, diag build. - A scripted walk of 110 s with camera turns (`LEONIDA_KEYS`). - A timeline of 12 frames every 3 s (`LEONIDA_TIMELINE`). - The switch flipped by turns of 5 s inside the run (`LEONIDA_AB=5,LEONIDA_HW_RT_REGION_QUERY`), over two runs. | | timelines | holding a walk of 20 ms or more from `hwrt.rs` | |---|---|---| | `VirtualQuery` (switch on) | 38 | 11 | | page by page (default now) | 33 | 0 | - One timeline straddled a turn of the switch and is left out. - In the timelines that hold a walk, the submitting thread's longest `GetWriteWatch` is 22-47 ms (0.2-2 ms in the others), and the frames are 50-65 ms among frames of 40-50. - The meter's walk was in 4 of 36 timelines of the run before the change and in 0 of 36 of the run after. - What this does not change: between the stalls the frames are the card's (37-45 ms of work a frame here), so the median while walking does not move. This removes the frames that stood out above it. - The pictures of the runs before and after are right. They were looked at, not compared pixel by pixel, because the walk does not repeat exactly. - A later stability run on the earlier head: 440 s, 0 device lost, 0 crashes, and a median frame of 48.8 ms over 7,510 frames in the world. ### Tested On this branch, rebuilt on `main` 312d88d1d: - `cargo check -p leonida-gpu`, with and without `--features diagnostics`: no warnings on this change's lines. The diagnostics build has one warning, in `book.rs`; it is on `main` too. - `cargo test -p leonida-gpu --lib --locked`: 731 passed, 0 failed, 59 ignored. With `--features diagnostics`: 812 passed, 0 failed, 59 ignored. - New tests: - `hwrt::tests::title_memory_is_asked_about_page_by_page` covers committed, read-only, closed and uncommitted pages, a range across them, a wrapping length, and that `VirtualQuery` was not asked. - `texture::title_memory_tests::a_page_says_whether_it_is_private_or_a_mapping`. - Red and green, by reverting the source by hand: - With `readable_len` sent back to the walk, the first test fails at "VirtualQuery asked" (9 walks against 0). - With `texture::shared` answering as the old code could not (always `Some(false)`), the second test fails on the mapping (`Some(false)` against `Some(true)`). - Restored, both pass. - On `main` neither test builds, because the functions and the count of walks are new. - A test cannot reach the protection bits that `texture::readable` now checks: Windows takes a page out of the working set as it closes it, so the one-byte read refuses that page with or without the check. Reverting the check leaves the test green. It is kept as a guard, and the test's comment says so. - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md`: passes. - `python -I tests/test_d3d12_switches.py`: 22 OK. - `python -I scripts/check_no_game_data.py` on the changed files: exit 0. GPUs tested: NVIDIA GeForce RTX 4090, driver 621.24, Windows 11 (CPU: Intel i9-13900K) AI-assisted: yes. Claude Code; Claude Fable 5.2 directing, Claude Opus 5.5 writing and reviewing. - Before the move, a separate read-only reviewer agent (Claude Opus) audited the diff. Its findings are in this commit: a third walk left on the default path, the protection of working-set pages, a dead-code warning, the shared count of walks, and timings. - On this base, a second review pass by Claude Opus 5.5 found that the test's comment claimed the protection bits were exercised. That comment is corrected in the follow-up commit. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With hardware ray tracing, a batch of bottom-level builds asked how far a
geometry's title memory can be read with VirtualQuery, which walks the page
tables to the end of the run of pages: 21-25 ms a question in the title's
pools, and the submitting thread's GetWriteWatch stood behind it for up to
47 ms. hwrt.rs asks page by page now (texture::readable_bytes);
LEONIDA_HW_RT_REGION_QUERY=1 asks as before. texture::readable leaves a
page of the working set that is PAGE_NOACCESS or a guard to the read, as
its comment said it did.

The frame meter's five-second lines asked VirtualQuery for the kind of
memory of the ten ranges most copied from, one walk of 24-28 ms each time.
They ask about the one page now (texture::shared, compiled with diagnostics
or tests only, where its one caller is).

The test's count of walks is kept per thread, so that another test asking
the walk at the same time does not move it. switches.md regenerated.

Carries the change of pull request #3113 (its head 5ce6907bd here) onto
main 312d88d1d as one commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From a second review on this base: a page closed with VirtualProtect
(PAGE_NOACCESS or PAGE_GUARD) after it was touched leaves the working
set as it is closed, so the test's last case is refused by the one-byte
read, not by the protection bits texture::readable looks at; with those
bits not looked at the test still passes. The comment said the page was
in the working set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
First-time contributor

In-game run report, head 3889530c7 (on main 312d88d1d)

  • RTX 4090, driver 621.24, i9-13900K, 64 GB, Windows 11. Series X profile, 2560x1440, -HardwareRT -NoFrameGen, diag build (diagnostics,dlss,mimalloc), LEONIDA_WINDOWS_BAR_MB=8192. LEONIDA_HW_RT_REGION_QUERY not set, so the page-by-page path of this pull request ran.
  • 440 s with the window up, about 6.5 minutes of it in the world: a scripted walk in a loop with camera turns (LEONIDA_KEYS_FILE).
  • 0 device lost, 0 panics, 0 ERROR lines.
  • In the world after the load settled, 9,015 frames: median 40.9 ms, p90 50.4 ms, p99 69.8 ms.
  • 38 frames over 100 ms in that time. This was the first start of this build. The five longest (0.75 to 2.2 s) each hold shader translations and host mesh pipelines made at their first draw (shader translated, host mesh pipeline lines inside the frame); that is main's behaviour and not this change. I did not go through the other 33 one by one.
  • Six pictures over the run (140 s to 430 s) were looked at: the scene is right in each (deck, house wall, water, vegetation, character).

Not measured again on this base: the by-turns count of walks in the description. That table is from the earlier head.

AI-assisted: yes (Claude Code; the run was started and its log and pictures read by Claude Fable 5.2).

### In-game run report, head 3889530c7 (on `main` 312d88d1d) - RTX 4090, driver 621.24, i9-13900K, 64 GB, Windows 11. Series X profile, 2560x1440, `-HardwareRT -NoFrameGen`, diag build (`diagnostics,dlss,mimalloc`), `LEONIDA_WINDOWS_BAR_MB=8192`. `LEONIDA_HW_RT_REGION_QUERY` not set, so the page-by-page path of this pull request ran. - 440 s with the window up, about 6.5 minutes of it in the world: a scripted walk in a loop with camera turns (`LEONIDA_KEYS_FILE`). - **0 device lost, 0 panics, 0 ERROR lines.** - In the world after the load settled, 9,015 frames: median 40.9 ms, p90 50.4 ms, p99 69.8 ms. - 38 frames over 100 ms in that time. This was the first start of this build. The five longest (0.75 to 2.2 s) each hold shader translations and host mesh pipelines made at their first draw (`shader translated`, `host mesh pipeline` lines inside the frame); that is `main`'s behaviour and not this change. I did not go through the other 33 one by one. - Six pictures over the run (140 s to 430 s) were looked at: the scene is right in each (deck, house wall, water, vegetation, character). Not measured again on this base: the by-turns count of walks in the description. That table is from the earlier head. AI-assisted: yes (Claude Code; the run was started and its log and pictures read by Claude Fable 5.2).
Author
First-time contributor

Follow-up to the run report: a second run of the same build lost the device

I ran the same exe (built at 3889530c7; the head is now e9670aede, a merge of main that touches only the progress dashboard) a second time, same settings and walk, as a control for something else. This one must be on record too:

  • 5 min 18 s after the start (about 4 minutes in the world, 8,284 frames, median 41.7 ms) the device was removed: 0x887A0005, "The GPU device instance has been suspended", no device-removed data. No panic. The submitting thread was preparing a submission of 2 lists; BLAS memory 536 MB live of a 1536 MB budget, 0 evicted.
  • So of two runs of this build on this PC, one ran its 440 s clean and one lost the device.
  • I cannot say from one loss whether this change has a part in it. main with -HardwareRT on this card has lost the device before without this change (the late-read BLAS transforms discussed in #3297, whose fix is not in main), and the earlier head of this change ran 440 s clean before the move. But that is not shown for this run: the log names no command (no LEONIDA_D3D12_DEBUG=1).
  • What I will do: run main 528614662 itself and this head again, each with LEONIDA_D3D12_DEBUG=1, and report both here.

AI-assisted: yes (Claude Code, Claude Fable 5.2).

### Follow-up to the run report: a second run of the same build lost the device I ran the same exe (built at 3889530c7; the head is now e9670aede, a merge of `main` that touches only the progress dashboard) a second time, same settings and walk, as a control for something else. This one must be on record too: - 5 min 18 s after the start (about 4 minutes in the world, 8,284 frames, median 41.7 ms) the device was removed: `0x887A0005`, "The GPU device instance has been suspended", no device-removed data. No panic. The submitting thread was preparing a submission of 2 lists; BLAS memory 536 MB live of a 1536 MB budget, 0 evicted. - So of two runs of this build on this PC, one ran its 440 s clean and one lost the device. - I cannot say from one loss whether this change has a part in it. `main` with `-HardwareRT` on this card has lost the device before without this change (the late-read BLAS transforms discussed in #3297, whose fix is not in `main`), and the earlier head of this change ran 440 s clean before the move. But that is not shown for this run: the log names no command (no `LEONIDA_D3D12_DEBUG=1`). - What I will do: run `main` 528614662 itself and this head again, each with `LEONIDA_D3D12_DEBUG=1`, and report both here. AI-assisted: yes (Claude Code, Claude Fable 5.2).
Author
First-time contributor

The two runs promised above, each with LEONIDA_D3D12_DEBUG=1

Same PC, settings and scripted walk, 440 s each.

device lost panics ERROR lines frames median
main 528614662 0 0 0 5,672 80.2 ms
this change (exe at 3889530c7) 0 0 0 5,764 88.2 ms
  • Neither lost the device, and the debug layer named nothing (no ERROR line in either log).
  • The debug layer makes the frames about twice as long, so each of these covers fewer frames than the run that lost the device (8,284), and a timing-dependent fault could hide behind it. So the loss is not reproduced and not explained: one loss in three runs of this build (two without the debug layer, one with), none in one run of main (with it). That is too few runs to say main is free of it or that this change is.
  • Pictures of both were looked at. Both draw the scene; both show the same heavy speckle in glass reflections and very dark shade under roofs with -HardwareRT, so that is main's picture and not this change's.

If a maintainer wants more before a decision, tell me how many clean runs without the debug layer would count, and I will run main and this head in turn that many times.

AI-assisted: yes (Claude Code, Claude Fable 5.2).

### The two runs promised above, each with `LEONIDA_D3D12_DEBUG=1` Same PC, settings and scripted walk, 440 s each. | | device lost | panics | ERROR lines | frames | median | |---|---|---|---|---|---| | `main` 528614662 | 0 | 0 | 0 | 5,672 | 80.2 ms | | this change (exe at 3889530c7) | 0 | 0 | 0 | 5,764 | 88.2 ms | - Neither lost the device, and the debug layer named nothing (no ERROR line in either log). - The debug layer makes the frames about twice as long, so each of these covers fewer frames than the run that lost the device (8,284), and a timing-dependent fault could hide behind it. So the loss is **not reproduced and not explained**: one loss in three runs of this build (two without the debug layer, one with), none in one run of `main` (with it). That is too few runs to say `main` is free of it or that this change is. - Pictures of both were looked at. Both draw the scene; both show the same heavy speckle in glass reflections and very dark shade under roofs with `-HardwareRT`, so that is `main`'s picture and not this change's. If a maintainer wants more before a decision, tell me how many clean runs without the debug layer would count, and I will run `main` and this head in turn that many times. AI-assisted: yes (Claude Code, Claude Fable 5.2).
From review: the test asserted the expected values and that the walk
was not asked, but never compared the new answer with the old one, and
the old function passes every value assertion too. It now asks
readable_len and readable_len_by_query the same question for each case
it builds (whole pages, a start inside a page, an end inside the last,
the read-only page, the page that is not there, a wrapping length, and
the page closed after it was touched) before it takes the walk count,
so the "VirtualQuery asked" assertion still covers the default path.
With readable_bytes counting the last page whatever it is, the new
assertion fails (0x2001 bytes: 8193 against 8192); restored, it passes.

Also from review: the page-wise answer reads one byte of each page not
in the working set, so a non-resident page is brought in on the asking
thread. That is paid either way only for pages the build then reads,
not for the 256 KiB vertex-index window decode_title_meshlet_ib asks
about, and a guard page in a range is touched and guarded again by the
fault handler. readable_len's comment and the findings section now say
so. The protection mask in texture::readable is left as it is; its
comment now says it is only a safeguard no test reaches. No behaviour
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
First-time contributor

A second read-only review of this branch (Claude Opus 5.5), and what changed for it. The head is now 83e33b76d, with main a9361504a merged in; the hashes in the description are older.

What the review checked

  • It compared the page-wise answer with the VirtualQuery walk case by case: committed but not resident, reserved, PAGE_NOACCESS or guard pages, ranges across regions, a last partial page, wrapping lengths. It found no input where a BLAS build gets bytes the walk refused, or a different length.
  • It found no path from this change to the device loss reported above. That loss is still unexplained.

Changed (1b7b5a29a)

  • The test now asks readable_len and readable_len_by_query the same question in 14 cases, and they must agree. Before, the old function passed every value assertion too. Red: with readable_bytes counting the last page whatever it is, the new assertion fails (0x2001 bytes: 8193 against 8192). Restored, it passes.
  • cargo test -p leonida-gpu --lib --locked on the merged head: 739 passed, 0 failed, 60 ignored.

A correction to the description

"That fault is paid either way" is too strong. The page-wise answer reads one byte of each page not in the working set, which brings it in on the submitting thread. That is paid either way only for pages the BLAS build then reads, not for the rest of the 256 KiB vertex-index window that decode_title_meshlet_ib asks about (up to 66 pages brought in for the question alone). A guard page met in a range is touched and then guarded again by the fault handler. The comment on readable_len and the findings section now say this. It is the side effect already noted on #3113.

Also

  • The protection mask in texture::readable is only a safeguard: Windows keeps such a page out of the working set, so no test reaches it. Its comment says so now. I can take it out if you would rather not carry it.
  • This and #3413 both add a section at the end of findings.md, so whichever lands second needs a merge there.

🤖 Generated with Claude Code

A second read-only review of this branch (Claude Opus 5.5), and what changed for it. The head is now 83e33b76d, with `main` a9361504a merged in; the hashes in the description are older. **What the review checked** - It compared the page-wise answer with the `VirtualQuery` walk case by case: committed but not resident, reserved, `PAGE_NOACCESS` or guard pages, ranges across regions, a last partial page, wrapping lengths. It found no input where a BLAS build gets bytes the walk refused, or a different length. - It found no path from this change to the device loss reported above. That loss is still unexplained. **Changed (1b7b5a29a)** - The test now asks `readable_len` and `readable_len_by_query` the same question in 14 cases, and they must agree. Before, the old function passed every value assertion too. Red: with `readable_bytes` counting the last page whatever it is, the new assertion fails (0x2001 bytes: 8193 against 8192). Restored, it passes. - `cargo test -p leonida-gpu --lib --locked` on the merged head: 739 passed, 0 failed, 60 ignored. **A correction to the description** "That fault is paid either way" is too strong. The page-wise answer reads one byte of each page not in the working set, which brings it in on the submitting thread. That is paid either way only for pages the BLAS build then reads, not for the rest of the 256 KiB vertex-index window that `decode_title_meshlet_ib` asks about (up to 66 pages brought in for the question alone). A guard page met in a range is touched and then guarded again by the fault handler. The comment on `readable_len` and the findings section now say this. It is the side effect already noted on #3113. **Also** - The protection mask in `texture::readable` is only a safeguard: Windows keeps such a page out of the working set, so no test reaches it. Its comment says so now. I can take it out if you would rather not carry it. - This and #3413 both add a section at the end of `findings.md`, so whichever lands second needs a merge there. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
First-time contributor

Local validation of head 83e33b76da754170feef54669967e722b33eecb6 applied to main 6491bc1a15bf8b1f2ed817ac3e78e8ee6d9899ef, on NVIDIA RTX 3090 24 GiB, driver 610.88, Windows 11, Ryzen 9 5900X, 32 GiB RAM. Both optimized binaries were freshly built with Rust 1.98.1 and diagnostics,dlss,mimalloc.

  • Default workspace: 1,924 passed, 76 ignored, without the depth-test CLI skip. Counts are test-harness results: four optional compiler-oracle checks and four retail-dependent loader checks returned early with their prerequisites unset. Default replay ran zero tests.
  • Diagnostics: GPU 882 passed, 60 ignored; HLE 312 unit plus one integration passed, two ignored; explicit replay one passed. The diagnostics GPU test process was associated with the physical RTX 3090 through its executable identity and NVIDIA process record.
  • Nine focused title-memory tests passed. Three behavioral red runs reached the intended assertions and exited 101; source restoration was hash-verified. Clean-room, documentation and switch checks passed. These checks do not establish concurrent equivalence or dynamically exercise every protection-mask case.
  • Unchanged stock gates, Series S with HWRT, DLSS/FG disabled: candidate PASS 305.614 world seconds; plain main PASS 302.286 world seconds. Both actual game exits and collected launcher commands were zero. DXR initialization and positive BLAS, quantized-vertex and meshlet counters demonstrate affected-path activity.

Both legs failed to reach the stock driver's control/teleport transition: no CONTROL, teleport, location marks or native action commands were observed, and no action response log appeared. This supports world stability and HWRT activation only, with no busy-location, image-quality or performance result. The same coverage gap on main does not establish its cause. The earlier RTX 4090 non-debug device loss remains unexplained by these clean RTX 3090 diagnostics-feature runs; these did not enable the D3D12 debug layer.

AI-assisted validation: GPT-6.1 Sol, xhigh. Independent read-only review: GPT-6.1 Sol (xhigh), source/call paths and frozen test, build and runtime evidence; the reviewer executed no new tests.

Local validation of head `83e33b76da754170feef54669967e722b33eecb6` applied to main `6491bc1a15bf8b1f2ed817ac3e78e8ee6d9899ef`, on NVIDIA RTX 3090 24 GiB, driver 610.88, Windows 11, Ryzen 9 5900X, 32 GiB RAM. Both optimized binaries were freshly built with Rust 1.98.1 and `diagnostics,dlss,mimalloc`. - Default workspace: 1,924 passed, 76 ignored, without the depth-test CLI skip. Counts are test-harness results: four optional compiler-oracle checks and four retail-dependent loader checks returned early with their prerequisites unset. Default replay ran zero tests. - Diagnostics: GPU 882 passed, 60 ignored; HLE 312 unit plus one integration passed, two ignored; explicit replay one passed. The diagnostics GPU test process was associated with the physical RTX 3090 through its executable identity and NVIDIA process record. - Nine focused title-memory tests passed. Three behavioral red runs reached the intended assertions and exited 101; source restoration was hash-verified. Clean-room, documentation and switch checks passed. These checks do not establish concurrent equivalence or dynamically exercise every protection-mask case. - Unchanged stock gates, Series S with HWRT, DLSS/FG disabled: candidate PASS 305.614 world seconds; plain main PASS 302.286 world seconds. Both actual game exits and collected launcher commands were zero. DXR initialization and positive BLAS, quantized-vertex and meshlet counters demonstrate affected-path activity. Both legs failed to reach the stock driver's control/teleport transition: no CONTROL, teleport, location marks or native action commands were observed, and no action response log appeared. This supports world stability and HWRT activation only, with no busy-location, image-quality or performance result. The same coverage gap on main does not establish its cause. The earlier RTX 4090 non-debug device loss remains unexplained by these clean RTX 3090 diagnostics-feature runs; these did not enable the D3D12 debug layer. AI-assisted validation: GPT-6.1 Sol, xhigh. Independent read-only review: GPT-6.1 Sol (xhigh), source/call paths and frozen test, build and runtime evidence; the reviewer executed no new tests.
Sign in to join this conversation.
No description provided.