d3d12: write the pipeline book before a GPU failure or the title's end terminates the process (D3D12-PIPELINE-BOOK-FLUSH-ON-GPU-FAILURE) #3146

Merged
Kal0s-design merged 3 commits from upstream-pr/3146 into main 2026-12-03 16:55:13 +00:00
Kal0s-design commented 2026-12-02 13:57:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T13:57:49Z.


Claimed in the coordination issue as: D3D12-PIPELINE-BOOK-FLUSH-ON-GPU-FAILURE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7278399665, status update https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7278452388)

What and why

The pipeline book (LEONIDA_PIPELINE_BOOK=1, d3d12/crates/leonida-gpu/src/pipeline/known.rs) is written only by its own thread, which wakes every two seconds. Two places end the process without waiting for it:

  • host_gpu_failed in d3d12/crates/leonida-hle/src/modules/d3d12x.rs logs the failure and calls TerminateProcess at once. The pipelines noted in the last seconds before a device loss are lost, and those are the ones the next run needs most.
  • end() in d3d12/crates/leonida-hle/src/modules/lifecycle.rs saves the pipeline cache and then terminates, again leaving the book to its two-second timer.

The change: the book's thread now also takes requests (a small writer module in known.rs). known::flush_on_gpu_failure() asks it to write and waits 250 ms at most; known::flush_on_exit() does the same with a 2 s limit. The calling thread takes no lock of the book itself, since a failing thread may hold one the write needs, so a stalled write can't keep the process from ending. The writer starts with the book itself, so without LEONIDA_PIPELINE_BOOK (or before the book is first used) both calls do nothing.

It only touches the writer thread of the book (RT-GRAPHICS-PIPELINE-BOOK), not what the book records. #2957 also edits known.rs (other lines); whichever lands second needs a trivial rebase.

This ports Yoshi-233's fix from the sibling VIctory tree (TaynanGT/Vice-Tay 33439c8, GPL-3.0, suggested by sharan104), credited as co-author.

Tested

  • New tests pipeline::known::writer::tests::a_request_returns_after_the_writer_wrote (a request returns only after the write ran) and a_stalled_write_does_not_hold_the_failing_thread (a write that never finishes still lets the request return after its timeout). main has no request path, so there is no red side for these. On main (09fbadec8) neither host_gpu_failed nor end() reaches the book at all.
  • Rebased on current main; cargo test -p leonida-gpu --lib: 693 passed, 0 failed, 59 ignored. cargo test -p leonida-hle --lib: 248 passed, 0 failed, 2 ignored.
  • cargo clippy -p leonida-gpu -p leonida-hle --lib --tests: no warning in the changed files.
  • Windows only, unit tests; the title wasn't run, so the device-loss path itself was not exercised.

GPUs tested: n/a (CPU unit tests)

AI-assisted: yes

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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5607918226 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T13:57:49Z. --- Claimed in the coordination issue as: D3D12-PIPELINE-BOOK-FLUSH-ON-GPU-FAILURE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7278399665, status update https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7278452388) ### What and why The pipeline book (`LEONIDA_PIPELINE_BOOK=1`, `d3d12/crates/leonida-gpu/src/pipeline/known.rs`) is written only by its own thread, which wakes every two seconds. Two places end the process without waiting for it: - `host_gpu_failed` in `d3d12/crates/leonida-hle/src/modules/d3d12x.rs` logs the failure and calls `TerminateProcess` at once. The pipelines noted in the last seconds before a device loss are lost, and those are the ones the next run needs most. - `end()` in `d3d12/crates/leonida-hle/src/modules/lifecycle.rs` saves the pipeline cache and then terminates, again leaving the book to its two-second timer. The change: the book's thread now also takes requests (a small `writer` module in `known.rs`). `known::flush_on_gpu_failure()` asks it to write and waits 250 ms at most; `known::flush_on_exit()` does the same with a 2 s limit. The calling thread takes no lock of the book itself, since a failing thread may hold one the write needs, so a stalled write can't keep the process from ending. The writer starts with the book itself, so without `LEONIDA_PIPELINE_BOOK` (or before the book is first used) both calls do nothing. It only touches the writer thread of the book (RT-GRAPHICS-PIPELINE-BOOK), not what the book records. #2957 also edits `known.rs` (other lines); whichever lands second needs a trivial rebase. This ports Yoshi-233's fix from the sibling VIctory tree (TaynanGT/Vice-Tay `33439c8`, GPL-3.0, suggested by sharan104), credited as co-author. ### Tested - New tests `pipeline::known::writer::tests::a_request_returns_after_the_writer_wrote` (a request returns only after the write ran) and `a_stalled_write_does_not_hold_the_failing_thread` (a write that never finishes still lets the request return after its timeout). `main` has no request path, so there is no red side for these. On `main` (`09fbadec8`) neither `host_gpu_failed` nor `end()` reaches the book at all. - Rebased on current `main`; `cargo test -p leonida-gpu --lib`: 693 passed, 0 failed, 59 ignored. `cargo test -p leonida-hle --lib`: 248 passed, 0 failed, 2 ignored. - `cargo clippy -p leonida-gpu -p leonida-hle --lib --tests`: no warning in the changed files. - Windows only, unit tests; the title wasn't run, so the device-loss path itself was not exercised. GPUs tested: n/a (CPU unit tests) AI-assisted: yes ### 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)
merzleckeier commented 2026-12-02 14:17:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T14:17:43Z.

Review: COMMENTED


Independent CPU-only test of c98f12833 on current main 69cd4106c. I compiled the exact writer module and flush function from the merged source with a small synthetic book in a temporary directory on Linux. Both stock writer tests passed. A third check staged bytes for both files and verified the explicit exit request and the two-second periodic write each appended both batches as expected.

One detail worth making explicit in the new request contract: the acknowledgement means the write attempt returned. I made the pipeline output path a directory in the same fixture. The request completed after the attempted append, the in-memory batch was drained, and removing the obstacle and requesting another flush did not recover that batch. This behavior comes from the existing flush implementation (identical on main); the new request adds a bounded wait around it. Describing the request as best-effort would make that limit clear to readers. Synthetic files only. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6152568248 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146#pullrequestreview-6152568248). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T14:17:43Z. **Review:** COMMENTED --- Independent CPU-only test of `c98f12833` on current main `69cd4106c`. I compiled the exact `writer` module and `flush` function from the merged source with a small synthetic book in a temporary directory on Linux. Both stock writer tests passed. A third check staged bytes for both files and verified the explicit exit request and the two-second periodic write each appended both batches as expected. One detail worth making explicit in the new request contract: the acknowledgement means the write attempt returned. I made the pipeline output path a directory in the same fixture. The request completed after the attempted append, the in-memory batch was drained, and removing the obstacle and requesting another flush did not recover that batch. This behavior comes from the existing `flush` implementation (identical on main); the new request adds a bounded wait around it. Describing the request as best-effort would make that limit clear to readers. Synthetic files only. AI-assisted with OpenAI Codex.
Kal0s-design commented 2026-12-02 14:33:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T14:33:54Z.


Thanks, agreed. The batch is taken out of the book before the write, so a failed append drops it, on main as well. ebc0253ff now says so in the doc comments: flush_on_gpu_failure is best effort, and the writer's answer means the write was tried, not that it succeeded. Comments only; pipeline::known tests pass (4/4).

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7348761128 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146#issuecomment-7348761128). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T14:33:54Z. --- Thanks, agreed. The batch is taken out of the book before the write, so a failed append drops it, on `main` as well. `ebc0253ff` now says so in the doc comments: `flush_on_gpu_failure` is best effort, and the writer's answer means the write was tried, not that it succeeded. Comments only; `pipeline::known` tests pass (4/4). AI-assisted: yes
lixonik commented 2026-12-02 14:55:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T14:55:33Z.


Verified PR #3146 (ebc0253ff) merged cleanly onto main (acc350745) on Windows 10 x64 (Rust 1.98.1):

  • Clean-room check: python -I scripts/check_no_game_data.py PASS.
  • Unit tests (native Windows 10):
    • cargo test -p leonida-gpu --features diagnostics --lib --locked pipeline::known:: -- 4 passed, 0 failed (including a_request_returns_after_the_writer_wrote and a_stalled_write_does_not_hold_the_failing_thread).
    • cargo test -p leonida-hle --lib --locked -- 248 passed, 0 failed, 2 ignored.
  • Code review: Clean, bounded flush contract (250 ms on host_gpu_failed, 2 s on lifecycle::end), OnceLock<Writer> avoids spawning a second thread, and the updated doc comments accurately state that the flush acknowledgement is best-effort. Note for maintainers: #3151 also touches host_gpu_failed in d3d12/crates/leonida-hle/src/modules/d3d12x.rs, so whichever merges second will have a small 2-line merge in d3d12x.rs.

Verdict: PASS (CPU/unit tests only; no game launch).

AI-assisted: yes (Antigravity).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7349375800 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146#issuecomment-7349375800). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T14:55:33Z. --- Verified PR #3146 (`ebc0253ff`) merged cleanly onto `main` (`acc350745`) on Windows 10 x64 (Rust 1.98.1): - **Clean-room check:** `python -I scripts/check_no_game_data.py` PASS. - **Unit tests (native Windows 10):** - `cargo test -p leonida-gpu --features diagnostics --lib --locked pipeline::known::` -- **4 passed, 0 failed** (including `a_request_returns_after_the_writer_wrote` and `a_stalled_write_does_not_hold_the_failing_thread`). - `cargo test -p leonida-hle --lib --locked` -- **248 passed, 0 failed, 2 ignored**. - **Code review:** Clean, bounded flush contract (`250 ms` on `host_gpu_failed`, `2 s` on `lifecycle::end`), `OnceLock<Writer>` avoids spawning a second thread, and the updated doc comments accurately state that the flush acknowledgement is best-effort. Note for maintainers: #3151 also touches `host_gpu_failed` in `d3d12/crates/leonida-hle/src/modules/d3d12x.rs`, so whichever merges second will have a small 2-line merge in `d3d12x.rs`. Verdict: **PASS** (CPU/unit tests only; no game launch). AI-assisted: yes (Antigravity).
fiestorra commented 2026-12-02 16:19:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T16:19:24Z.


Verified here: the change applies and its tests pass, including the two new ones about the writer.

git apply of 128648cfe..ebc0253ff on main   (3 files)
cargo test -p leonida-gpu --lib -- --test-threads=1 known      exit 0, 14 passed, 0 failed

  pipeline::known::tests::a_state_comes_back_as_it_was ... ok
  pipeline::known::tests::a_torn_end_is_not_read ... ok
  pipeline::known::writer::tests::a_request_returns_after_the_writer_wrote ... ok
  pipeline::known::writer::tests::a_stalled_write_does_not_hold_the_failing_thread ... ok

The two writer tests are the ones this pull request exists for, and they say what matters: a request returns once the writer wrote, and a stalled write does not hold the failing thread - the second is precisely the property that makes this work on the path where TerminateProcess follows.

And this is the pull request I would merge for a reason outside itself: the book is only written by its own thread at the end, so a run that ends with a GPU failure loses it - and a run of this title has a GPU timeout in it. A real log from this week (RTX 4090, driver 621.24, -SeriesX -Resolution 1440) shows frame times flat at 35.7 ms until 22:03:50, then three and a half minutes of medians between 145 and 1,899 ms - a device timeout, after which the log notes the recovery. On that path the book was not written, and the next run pays for it again. That is exactly what this changes.

What I did not test: an actual GPU failure. That needs the title and a timeout induced on purpose, and this machine cannot run it; the writer's tests are the closest thing, and they pass.

One detail for the merge: the branch's merge base is 128648cfe, so it is some way behind main - a rebase before merging is worth it.

AI-assisted: yes - DeepSeek v4.1 (flash).

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7351772137 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146#issuecomment-7351772137). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T16:19:24Z. --- **Verified here: the change applies and its tests pass, including the two new ones about the writer.** ``` git apply of 128648cfe..ebc0253ff on main (3 files) cargo test -p leonida-gpu --lib -- --test-threads=1 known exit 0, 14 passed, 0 failed pipeline::known::tests::a_state_comes_back_as_it_was ... ok pipeline::known::tests::a_torn_end_is_not_read ... ok pipeline::known::writer::tests::a_request_returns_after_the_writer_wrote ... ok pipeline::known::writer::tests::a_stalled_write_does_not_hold_the_failing_thread ... ok ``` **The two `writer` tests are the ones this pull request exists for**, and they say what matters: **a request returns once the writer wrote, and a stalled write does not hold the failing thread** - the second is precisely the property that makes this work on the path where `TerminateProcess` follows. **And this is the pull request I would merge for a reason outside itself**: the book is only written by its own thread at the end, **so a run that ends with a GPU failure loses it** - **and a run of this title has a GPU timeout in it**. **A real log from this week** (RTX 4090, driver 621.24, `-SeriesX -Resolution 1440`) **shows frame times flat at 35.7 ms until 22:03:50, then three and a half minutes of medians between 145 and 1,899 ms** - **a device timeout, after which the log notes the recovery.** **On that path the book was not written, and the next run pays for it again.** **That is exactly what this changes.** **What I did not test**: **an actual GPU failure.** That needs the title and a timeout induced on purpose, and this machine cannot run it; **the writer's tests are the closest thing, and they pass.** **One detail for the merge**: the branch's merge base is `128648cfe`, **so it is some way behind `main`** - a rebase before merging is worth it. **AI-assisted:** yes - DeepSeek v4.1 (flash). Written with an AI assistant.
MoonEyes commented 2026-12-02 18:13:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:13:52Z.


Read against current main; not built here (leonida-gpu/leonida-hle are Windows-only). The head is unchanged since lixonik's (14:55) and fiestorra's (16:19) green Windows runs, and it still merges cleanly.

head      ebc0253ff
base      origin/main 45dc41f95, merge base 128648cfe, merged locally without conflict
CI        6 check runs on the head, all green
Command (on the merge, Linux) Result
python -I tests/test_d3d12_switches.py 20 tests, OK (no new switch)
python -I scripts/check_no_game_data.py on the 3 files exit 0

Read in the diff

  • known.rs: the two-second sleep loop becomes a Writer thread that waits on recv_timeout(2 s), so a flush request is served at once and the periodic write stays the same. request_flush waits with a bound (250 ms on a GPU failure, 2 s at the title's end), and the failing thread takes no lock itself. That is the right shape for a call made just before TerminateProcess.
  • Both new tests are about the writer itself (it answers after writing; a stalled write does not hold the caller), and they run without a GPU.
  • lifecycle.rs flushes after save_pipeline_cache() and before TerminateProcess(…, 0). d3d12x.rs flushes after log_crash.

Note (not blocking): flush() appends shaders and then pipelines with plain write_all. If the 250 ms bound passes while a write is in progress, TerminateProcess can cut the append short, which is the same risk the periodic writer already has on main. If the book's reader does not yet tolerate a truncated last record, that is worth a follow-up, since this PR makes writes right before termination more likely.

Verdict: ready.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354172804 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146#issuecomment-7354172804). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:13:52Z. --- **Read against current `main`; not built here (`leonida-gpu`/`leonida-hle` are Windows-only). The head is unchanged since lixonik's (14:55) and fiestorra's (16:19) green Windows runs, and it still merges cleanly.** ``` head ebc0253ff base origin/main 45dc41f95, merge base 128648cfe, merged locally without conflict CI 6 check runs on the head, all green ``` | Command (on the merge, Linux) | Result | |---|---| | `python -I tests/test_d3d12_switches.py` | 20 tests, OK (no new switch) | | `python -I scripts/check_no_game_data.py` on the 3 files | exit 0 | **Read in the diff** - `known.rs`: the two-second sleep loop becomes a `Writer` thread that waits on `recv_timeout(2 s)`, so a flush request is served at once and the periodic write stays the same. `request_flush` waits with a bound (250 ms on a GPU failure, 2 s at the title's end), and the failing thread takes no lock itself. That is the right shape for a call made just before `TerminateProcess`. - Both new tests are about the writer itself (it answers after writing; a stalled write does not hold the caller), and they run without a GPU. - `lifecycle.rs` flushes after `save_pipeline_cache()` and before `TerminateProcess(…, 0)`. `d3d12x.rs` flushes after `log_crash`. **Note (not blocking):** `flush()` appends shaders and then pipelines with plain `write_all`. If the 250 ms bound passes while a write is in progress, `TerminateProcess` can cut the append short, which is the same risk the periodic writer already has on `main`. If the book's reader does not yet tolerate a truncated last record, that is worth a follow-up, since this PR makes writes right before termination more likely. **Verdict: ready.** AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
Kal0s-design commented 2026-12-02 18:35:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T18:35:40Z.


Thanks for the review. On the note about a cut-short append: the reader already handles it, and this PR is where that was added (head ebc0253ff, known.rs).

  • At load, book() walks both files, and walk_shaders / walk_pipelines stop at the last whole record and return its end. If the file is longer than that, it is cut back to that end with set_len(end) before anything new is appended. So a torn record from a run killed mid-append is dropped once, and the next append starts on a record boundary.
  • a_torn_end_is_not_read covers it: three pipeline records with the last 5 bytes cut off read back as 2 records (48 bytes), and a shader file with a partial second record reads back as the first record only.

So the worst case after TerminateProcess cuts the flush short is losing the record being written, not the book.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354847169 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146#issuecomment-7354847169). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T18:35:40Z. --- Thanks for the review. On the note about a cut-short append: the reader already handles it, and this PR is where that was added (head `ebc0253ff`, `known.rs`). - At load, `book()` walks both files, and `walk_shaders` / `walk_pipelines` stop at the last whole record and return its end. If the file is longer than that, it is cut back to that end with `set_len(end)` before anything new is appended. So a torn record from a run killed mid-append is dropped once, and the next append starts on a record boundary. - `a_torn_end_is_not_read` covers it: three pipeline records with the last 5 bytes cut off read back as 2 records (48 bytes), and a shader file with a partial second record reads back as the first record only. So the worst case after `TerminateProcess` cuts the flush short is losing the record being written, not the book. AI-assisted: yes (Claude Code).
EdenBendheim commented 2026-12-02 21:01:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-02T21:01:24Z.


RUN (in-game RTX 3090 300 s stress gate, 14-PR combined batch) — PASS covering exact head ebc0253ff944ca9dab30a41b7f1a5ef6a519448f.

  • Base & build: Merged cleanly via git merge --no-ff onto main b41763227 (diagnostics,dlss,mimalloc, exe_sha16 = c47eeb717f761d9d; changed-file clean-room scan exit 0; workspace test targets compiled).
  • Batch heads (14 PRs): #3200 d1a91afd1, #3198 80a627bb1, #3191 93b47ac9d, #3189 c182fc392, #3176 ae0075d9a, #3168 337388052, #3164 1065952da, #3146 ebc0253ff, #3124 64600ef0c, #3069 311d33a40, #3031 8df1bfce7, #3029 e49404808, #3054 ff53fd8b9, #3010 d645712a3.
  • Hardware & setup: Windows 11, Ryzen 9 5900X (32 GB RAM), NVIDIA GeForce RTX 3090 24 GB, driver 610.88, Series X profile, 2560x1440, -NoFrameGen, scripts/game-gate.ps1 (301.3 s in world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (GATE CONTROL moved=2.51 m, max_from_ctrl=5,053.9 m).
Metric 14-PR Batch (c47eeb717f761d9d) main b41763227 baseline (cf499737bf684f6a)
Gate verdict / exit PASS (clean, 0 reasons, 0 warnings) PASS (clean, 0 reasons, 0 warnings)
World time 301.3 s (4,504 frames) 305.6 s
Device lost / crashes / missed pipeline waits 0 / 0 / 0 0 / 0 / 0
Rendered FPS (median) / p95 frame time 20.10 FPS / 69.76 ms 19.13 FPS / 74.01 ms
Clean shutdown / cache_saved 0x00000000 / true 0x00000000 / true

Verdict: PASS for the 300 s in-game stability gate on ebc0253ff. (Confirms normal run + clean title shutdown with cache_saved = true; does not simulate a GPU device-loss path.)

(AI-assisted verification: gemini-4-neon + gpt-6.2-astra.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358676620 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146#issuecomment-7358676620). Originally posted by [EdenBendheim](https://github.com/EdenBendheim) on 2026-12-02T21:01:24Z. --- **RUN (in-game RTX 3090 300 s stress gate, 14-PR combined batch)** — **PASS** covering exact head `ebc0253ff944ca9dab30a41b7f1a5ef6a519448f`. - **Base & build:** Merged cleanly via `git merge --no-ff` onto `main` `b41763227` (`diagnostics,dlss,mimalloc`, `exe_sha16 = c47eeb717f761d9d`; changed-file clean-room scan exit `0`; workspace test targets compiled). - **Batch heads (`14` PRs):** `#3200` `d1a91afd1`, `#3198` `80a627bb1`, `#3191` `93b47ac9d`, `#3189` `c182fc392`, `#3176` `ae0075d9a`, `#3168` `337388052`, `#3164` `1065952da`, `#3146` `ebc0253ff`, `#3124` `64600ef0c`, `#3069` `311d33a40`, `#3031` `8df1bfce7`, `#3029` `e49404808`, `#3054` `ff53fd8b9`, `#3010` `d645712a3`. - **Hardware & setup:** Windows 11, Ryzen 9 5900X (32 GB RAM), NVIDIA GeForce RTX 3090 24 GB, driver `610.88`, Series X profile, `2560x1440`, `-NoFrameGen`, `scripts/game-gate.ps1` (`301.3 s` in world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (`GATE CONTROL moved=2.51 m`, `max_from_ctrl=5,053.9 m`). | Metric | 14-PR Batch (`c47eeb717f761d9d`) | `main` `b41763227` baseline (`cf499737bf684f6a`) | |---|---:|---:| | Gate verdict / exit | **PASS** (`clean`, `0` reasons, `0` warnings) | **PASS** (`clean`, `0` reasons, `0` warnings) | | World time | `301.3 s` (`4,504` frames) | `305.6 s` | | Device lost / crashes / missed pipeline waits | `0` / `0` / `0` | `0` / `0` / `0` | | Rendered FPS (median) / p95 frame time | `20.10 FPS` / `69.76 ms` | `19.13 FPS` / `74.01 ms` | | Clean shutdown / `cache_saved` | `0x00000000` / `true` | `0x00000000` / `true` | **Verdict:** **PASS** for the 300 s in-game stability gate on `ebc0253ff`. *(Confirms normal run + clean title shutdown with `cache_saved = true`; does not simulate a GPU device-loss path.)* *(AI-assisted verification: `gemini-4-neon` + `gpt-6.2-astra`.)*
fiestorra commented 2026-12-02 23:55:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T23:55:45Z.


VERIFY-3146 — Windows nativo: documentación, y la documentación es correcta

Own commit ebc0253ff — pipeline/known.rs, docs only (6 insertions, 3 deletions of /// and //!)

Ran at the head

cargo test -p leonida-gpu --lib known     14 passed; 0 failed

There is nothing to make red — no behaviour changes — so the only verification worth doing is whether the sentences are true. They are:

The claim: "Best effort: it returns once the write was tried, and a write that fails drops what it was writing, as the periodic write does." The code (known.rs:179):

pub(super) fn request_flush(&self, timeout: Duration) {
    let (done, finished) = mpsc::channel();
    if self.requests.send(done).is_ok() {
        let _ = finished.recv_timeout(timeout);
    }
}

recv_timeout's result is thrown away — so on a timeout, or a writer that failed, the caller cannot tell, exactly as the doc now says. And flush_on_gpu_failure waits 250 ms while flush_on_exit waits 2 s, which the surrounding docs point at.

Why this kind of change is worth a review rather than a shrug: the old text implied a flush that happened, and every caller of flush_on_gpu_failure() now reads a sentence that says it may not have. A doc line that under-promises is how the next person stops treating a timeout as success — and the fact that the previous text was also describing this code is the reason nobody had noticed.

What I could not test: the writer thread against a real failure (a failing write is what the sentence is about), and no title.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7362596619 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3146#issuecomment-7362596619). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T23:55:45Z. --- ## VERIFY-3146 — Windows nativo: documentación, y **la documentación es correcta** | | | |---|---| | Own commit | `ebc0253ff` — `pipeline/known.rs`, **docs only** (6 insertions, 3 deletions of `///` and `//!`) | **Ran at the head** ``` cargo test -p leonida-gpu --lib known 14 passed; 0 failed ``` **There is nothing to make red** — no behaviour changes — **so the only verification worth doing is whether the sentences are true.** They are: **The claim**: *"Best effort: it returns once the write was tried, and a write that fails drops what it was writing, as the periodic write does."* **The code** (`known.rs:179`): ```rust pub(super) fn request_flush(&self, timeout: Duration) { let (done, finished) = mpsc::channel(); if self.requests.send(done).is_ok() { let _ = finished.recv_timeout(timeout); } } ``` **`recv_timeout`'s result is thrown away** — **so on a timeout, or a writer that failed, the caller cannot tell**, exactly as the doc now says. **And `flush_on_gpu_failure` waits 250 ms while `flush_on_exit` waits 2 s, which the surrounding docs point at.** **Why this kind of change is worth a review rather than a shrug**: **the old text implied a flush that happened**, and every caller of `flush_on_gpu_failure()` now reads a sentence that says **it may not have.** **A doc line that under-promises is how the next person stops treating a timeout as success** — and the fact that the previous text was *also* describing this code is the reason nobody had noticed. **What I could not test**: the writer thread against a real failure (a failing write is what the sentence is about), and no title. Written with an AI assistant.
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
ProjectLeonida/mandy!3146
No description provided.