fix(vi): drain the present trace on a Windows windowless stop #3266

Merged
HumanBean merged 2 commits from futondestroyer/Longshot:fix/windows-present-trace-drain-e13 into main 2026-12-05 17:39:48 +00:00
Member

Summary

On Windows, enable HOS_PRESENT_TRACE in a windowless game and close it through its stop window while rows are buffered. The game can exit successfully with the last batch missing from presents.csv.

The windowless stop worker now closes the trace stream after the normal close work and before terminating the process. The writer and drain share a lock, so the drain waits for an admitted write and prevents a late present from reopening the file. Read stop_worker in host/windows_stop.c and hos_vi_present_trace_end in host/nn_vi.c first.

Testing

Tested: Windows 11 26H2, RTX 4070, NVIDIA 621.01. Alternated two stock and two fixed windowless launches at the Kokiri Forest checkpoint and closed each through the native stop window. All four game processes and their Builder supervisors exited with code 0. The fixed trace contained every observed present, with complete, contiguous CSV rows. A fifth fixed launch with tracing disabled exited through the same route and produced no CSV. Both builds accepted a Unicode trace path.

The Windows regression on e13b792f and fbc988fb retained frames 1–4 on stock and 1–5 with the fix under LLVM-MinGW and GCC. Visible-window, control-bridge and normal C runtime exits passed, along with repeat drain, drain before opening, tracing disabled, and watchdog cases. An independent test verified that the drain waits for an admitted write, rejects a late write, and leaves separately buffered output alone. Removing the drain reproduces the missing fifth row. Removing the seal lets the late frame overwrite the trace.

Both changed Windows translation units passed syntax checking on the replay and its parent with the Builder’s diagnostic flags. With extra warnings enabled, both revisions report the same missing declarations for rx_menu_open and rx_display_refresh_mhz. Supplying their existing header for that diagnostic check clears both errors. Formatting, Python lint, workflow lint and a separate commit-range secret scan passed.

The gameplay comparison below used the ABI 95 builds it names. The production patch replayed unchanged on ABI 98. The tested 60 FPS active-play route uses the same pacing period, trace stream and windowless stop sequence. The fixture still exercises the native stop route and now also extracts the upstream pacing helpers. The WIP keeps the exact game-free-tested head fbc988fb on e13b792f. It merged cleanly in a local preview against active main 754bd6d8, which has the same trace and stop sources as e13b792f.

The full strict Windows suite on fbc988fb recorded 787 passes, 76 failures and 52 skips. All 76 failures reproduced on e13b792f using the same pinned tools and flags.

Strict Windows failures also reproduced on the branch base
  • tests/test_astc_reuse.py
  • tests/test_capture_copy_helpers.py
  • tests/test_cbuf_table_extent.py
  • tests/test_coverage_run.py
  • tests/test_cv_handoff_threads.py
  • tests/test_cv_signal_race.py
  • tests/test_dev_update.py
  • tests/test_display_pointer.py
  • tests/test_dlss_actor.py
  • tests/test_dlss_checks.py
  • tests/test_dlssg.py
  • tests/test_drawn_writeback.py
  • tests/test_driver_faults.py
  • tests/test_fallback_lanes.py
  • tests/test_fallback_size_policy.py
  • tests/test_fg_scale_sharpen.py
  • tests/test_fixed_share_upscale_shader.py
  • tests/test_fps_overlay_order.py
  • tests/test_fps_stats.py
  • tests/test_fsr4_tune.py
  • tests/test_gpu_choice.py
  • tests/test_helpers_extract.py
  • tests/test_import_hold.py
  • tests/test_import_span.py
  • tests/test_import_windows.py
  • tests/test_jobs_wait_runs_queued.py
  • tests/test_lifter.py
  • tests/test_longshot_builder.py
  • tests/test_lower_atomg_cas.py
  • tests/test_lower_end_at_closing_branch.py
  • tests/test_lower_immediate_not_register.py
  • tests/test_lower_imnmx_wide_immediate.py
  • tests/test_lower_isberd_output.py
  • tests/test_lower_ldg_uniform_order.py
  • tests/test_lower_lea_hi_constant.py
  • tests/test_lower_r2ur_one_register.py
  • tests/test_lower_suld_1d.py
  • tests/test_lower_tld_ms.py
  • tests/test_mask_history_retire.py
  • tests/test_menu_env_on.py
  • tests/test_mirror_inherit.py
  • tests/test_mirror_trim.py
  • tests/test_native_zstd.py
  • tests/test_parity_gates.py
  • tests/test_pcache_stamp.py
  • tests/test_prepare_seed_stamp.py
  • tests/test_prepare_workers.py
  • tests/test_present_acquire_ahead.py
  • tests/test_present_held_image.py
  • tests/test_present_image_free.py
  • tests/test_present_semaphores.py
  • tests/test_program_cache_cleanup.py
  • tests/test_program_cache_reader.py
  • tests/test_program_cache_store_record.py
  • tests/test_program_record_head.py
  • tests/test_push_state.py
  • tests/test_quick_pipelines.py
  • tests/test_report_words.py
  • tests/test_seed_kept_loaded.py
  • tests/test_seed_reader.py
  • tests/test_skip_code.py
  • tests/test_sparse_bc_usage.py
  • tests/test_startup_progress.py
  • tests/test_taau_env_lookup.py
  • tests/test_target_overlap.py
  • tests/test_target_retention.py
  • tests/test_tex_spans_once_a_present.py
  • tests/test_ub_gap.py
  • tests/test_upscale_fallback.py
  • tests/test_upscale_independent.py
  • tests/test_vk_draw_overhead_lean.py
  • tests/test_vram_compact.py
  • tests/test_wb_diff_stale_shadow.py
  • tests/test_wb_learn.py
  • tests/test_wb_pages.py
  • tests/test_xinput_thread.py

Still to test:

  • Matching ABI 98 Windows runtime. At the active-play checkpoint, verify the same windowless close flushes the final CSV rows. By hand.
  • Native Linux host build in a UTF-8 checkout, including the shared present writer with tracing enabled and disabled. Confirm the writer builds with the POSIX SRWLOCK shim and the normal close keeps complete rows. By hand.

Measurements

Verdict: The fix kept all observed rows in both closes. Main dropped at least 31 and 25.

Setup: Same Windows 11 PC, RTX 4070 and driver 621.01, two interleaved runs per arm in windowless Kokiri Forest at a 60 FPS cap with frame generation and shader precompile disabled. Both builds used ABI 95, the same Builder and Rust library, and a single refreshed runtime slot. Row loss gives stock credit for one sampled present that might still be waiting to enter the writer. Each relinked host was verified with its own build receipt before launch.

Measurement Before: main @ 3a0f7d8f7f34360a464df614fc38a2a0c5bf6806 After: this PR @ 16f495ecfb04352b452001ee0893d7876242e67f
Minimum earlier rows missing, median and range 28 (25–31) 0 (0–0)
Complete rows added by close, median and range 0 (0–0) 25 (25–25)

Risks

With tracing enabled, a successful windowless close waits for the trace stream to finish writing. An OS-ending forced stop can still interrupt blocked storage I/O.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. The WIP is pinned to the tested e13b792f base. Refresh against current main before Ready.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). All Windows strict failures reproduced on e13b792f under the same tools and are listed above.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Windows syntax and ABI 95 gameplay passed. Native Linux is still open.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary On Windows, enable `HOS_PRESENT_TRACE` in a windowless game and close it through its stop window while rows are buffered. The game can exit successfully with the last batch missing from `presents.csv`. The windowless stop worker now closes the trace stream after the normal close work and before terminating the process. The writer and drain share a lock, so the drain waits for an admitted write and prevents a late present from reopening the file. Read `stop_worker` in `host/windows_stop.c` and `hos_vi_present_trace_end` in `host/nn_vi.c` first. ## Testing **Tested:** Windows 11 26H2, RTX 4070, NVIDIA 621.01. Alternated two stock and two fixed windowless launches at the Kokiri Forest checkpoint and closed each through the native stop window. All four game processes and their Builder supervisors exited with code 0. The fixed trace contained every observed present, with complete, contiguous CSV rows. A fifth fixed launch with tracing disabled exited through the same route and produced no CSV. Both builds accepted a Unicode trace path. The Windows regression on `e13b792f` and `fbc988fb` retained frames 1–4 on stock and 1–5 with the fix under LLVM-MinGW and GCC. Visible-window, control-bridge and normal C runtime exits passed, along with repeat drain, drain before opening, tracing disabled, and watchdog cases. An independent test verified that the drain waits for an admitted write, rejects a late write, and leaves separately buffered output alone. Removing the drain reproduces the missing fifth row. Removing the seal lets the late frame overwrite the trace. Both changed Windows translation units passed syntax checking on the replay and its parent with the Builder’s diagnostic flags. With extra warnings enabled, both revisions report the same missing declarations for `rx_menu_open` and `rx_display_refresh_mhz`. Supplying their existing header for that diagnostic check clears both errors. Formatting, Python lint, workflow lint and a separate commit-range secret scan passed. The gameplay comparison below used the ABI 95 builds it names. The production patch replayed unchanged on ABI 98. The tested 60 FPS active-play route uses the same pacing period, trace stream and windowless stop sequence. The fixture still exercises the native stop route and now also extracts the upstream pacing helpers. The WIP keeps the exact game-free-tested head `fbc988fb` on `e13b792f`. It merged cleanly in a local preview against active main `754bd6d8`, which has the same trace and stop sources as `e13b792f`. The full strict Windows suite on `fbc988fb` recorded 787 passes, 76 failures and 52 skips. All 76 failures reproduced on `e13b792f` using the same pinned tools and flags. <details> <summary>Strict Windows failures also reproduced on the branch base</summary> - `tests/test_astc_reuse.py` - `tests/test_capture_copy_helpers.py` - `tests/test_cbuf_table_extent.py` - `tests/test_coverage_run.py` - `tests/test_cv_handoff_threads.py` - `tests/test_cv_signal_race.py` - `tests/test_dev_update.py` - `tests/test_display_pointer.py` - `tests/test_dlss_actor.py` - `tests/test_dlss_checks.py` - `tests/test_dlssg.py` - `tests/test_drawn_writeback.py` - `tests/test_driver_faults.py` - `tests/test_fallback_lanes.py` - `tests/test_fallback_size_policy.py` - `tests/test_fg_scale_sharpen.py` - `tests/test_fixed_share_upscale_shader.py` - `tests/test_fps_overlay_order.py` - `tests/test_fps_stats.py` - `tests/test_fsr4_tune.py` - `tests/test_gpu_choice.py` - `tests/test_helpers_extract.py` - `tests/test_import_hold.py` - `tests/test_import_span.py` - `tests/test_import_windows.py` - `tests/test_jobs_wait_runs_queued.py` - `tests/test_lifter.py` - `tests/test_longshot_builder.py` - `tests/test_lower_atomg_cas.py` - `tests/test_lower_end_at_closing_branch.py` - `tests/test_lower_immediate_not_register.py` - `tests/test_lower_imnmx_wide_immediate.py` - `tests/test_lower_isberd_output.py` - `tests/test_lower_ldg_uniform_order.py` - `tests/test_lower_lea_hi_constant.py` - `tests/test_lower_r2ur_one_register.py` - `tests/test_lower_suld_1d.py` - `tests/test_lower_tld_ms.py` - `tests/test_mask_history_retire.py` - `tests/test_menu_env_on.py` - `tests/test_mirror_inherit.py` - `tests/test_mirror_trim.py` - `tests/test_native_zstd.py` - `tests/test_parity_gates.py` - `tests/test_pcache_stamp.py` - `tests/test_prepare_seed_stamp.py` - `tests/test_prepare_workers.py` - `tests/test_present_acquire_ahead.py` - `tests/test_present_held_image.py` - `tests/test_present_image_free.py` - `tests/test_present_semaphores.py` - `tests/test_program_cache_cleanup.py` - `tests/test_program_cache_reader.py` - `tests/test_program_cache_store_record.py` - `tests/test_program_record_head.py` - `tests/test_push_state.py` - `tests/test_quick_pipelines.py` - `tests/test_report_words.py` - `tests/test_seed_kept_loaded.py` - `tests/test_seed_reader.py` - `tests/test_skip_code.py` - `tests/test_sparse_bc_usage.py` - `tests/test_startup_progress.py` - `tests/test_taau_env_lookup.py` - `tests/test_target_overlap.py` - `tests/test_target_retention.py` - `tests/test_tex_spans_once_a_present.py` - `tests/test_ub_gap.py` - `tests/test_upscale_fallback.py` - `tests/test_upscale_independent.py` - `tests/test_vk_draw_overhead_lean.py` - `tests/test_vram_compact.py` - `tests/test_wb_diff_stale_shadow.py` - `tests/test_wb_learn.py` - `tests/test_wb_pages.py` - `tests/test_xinput_thread.py` </details> **Still to test:** - Matching ABI 98 Windows runtime. At the active-play checkpoint, verify the same windowless close flushes the final CSV rows. By hand. - Native Linux host build in a UTF-8 checkout, including the shared present writer with tracing enabled and disabled. Confirm the writer builds with the POSIX `SRWLOCK` shim and the normal close keeps complete rows. By hand. ## Measurements **Verdict:** The fix kept all observed rows in both closes. Main dropped at least 31 and 25. Setup: Same Windows 11 PC, RTX 4070 and driver 621.01, two interleaved runs per arm in windowless Kokiri Forest at a 60 FPS cap with frame generation and shader precompile disabled. Both builds used ABI 95, the same Builder and Rust library, and a single refreshed runtime slot. Row loss gives stock credit for one sampled present that might still be waiting to enter the writer. Each relinked host was verified with its own build receipt before launch. | Measurement | Before: main @ `3a0f7d8f7f34360a464df614fc38a2a0c5bf6806` | After: this PR @ `16f495ecfb04352b452001ee0893d7876242e67f` | | --- | --- | --- | | Minimum earlier rows missing, median and range | 28 (25–31) | 0 (0–0) | | Complete rows added by close, median and range | 0 (0–0) | 25 (25–25) | ## Risks With tracing enabled, a successful windowless close waits for the trace stream to finish writing. An OS-ending forced stop can still interrupt blocked storage I/O. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. The WIP is pinned to the tested `e13b792f` base. Refresh against current main before Ready. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). All Windows strict failures reproduced on `e13b792f` under the same tools and are listed above. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Windows syntax and ABI 95 gameplay passed. Native Linux is still open. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
Assisted-by: Codex
fix(vi): drain the present trace on a Windows windowless stop
Some checks failed
CI / What the change needs (pull_request) Successful in 7s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Waiting to run
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Waiting to run
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Waiting to run
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Waiting to run
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Waiting to run
CI / Website build and checks (pull_request) Waiting to run
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
PR description / Title and description (pull_request_target) Failing after 6s
fbc988fb5f
Assisted-by: Codex
Author
Member

Tested in game: Windows 11 26H2, RTX 4070, NVIDIA 621.01. In matched ABI 95 windowless Kokiri Forest runs, stock 3a0f7d8f missed at least 31 and 25 earlier present rows. Fix 16f495ec drained 25 more complete rows at each native WM_CLOSE and retained every observed present. The tracing-off run created no CSV. All five native and Builder exits returned zero. The same trace and stop patch is on fbc988fb, with exact ABI 98 focused and strict game-free results in the description.

Tested in game: Windows 11 26H2, RTX 4070, NVIDIA 621.01. In matched ABI 95 windowless Kokiri Forest runs, stock 3a0f7d8f missed at least 31 and 25 earlier present rows. Fix 16f495ec drained 25 more complete rows at each native WM_CLOSE and retained every observed present. The tracing-off run created no CSV. All five native and Builder exits returned zero. The same trace and stop patch is on fbc988fb, with exact ABI 98 focused and strict game-free results in the description.
Author
Member

@review Please review exact head fbc988fb5f37f183076dc78b50095f3f7bd183a1 for the Windows windowless present-trace drain. The ABI 98 source checks reproduce four rows on the branch base and retain all five with the fix. The gameplay figures in the description use the original ABI 95 builds.

@review Please review exact head `fbc988fb5f37f183076dc78b50095f3f7bd183a1` for the Windows windowless present-trace drain. The ABI 98 source checks reproduce four rows on the branch base and retain all five with the fix. The gameplay figures in the description use the original ABI 95 builds.
BeanBot left a comment

Recommendation: Approve. The reported Windows gameplay runs show that the drain recovers the missing trace rows. The exact ABI 98 runtime and the shared writer on Linux still need the runs identified by the author before merge. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The windowless Windows stop now closes the present trace before terminating, preserving buffered rows and sealing the stream against later writes. The shared writer gains a lock when tracing is enabled; the committed tests cover the shutdown routes but do not exercise the writer and drain concurrently.

Should fix (1): not blocking, but worth doing before merging.

  • L1 tests/test_present_trace.py:245: The checked-in shutdown tests never overlap a present write with the drain, so they do not protect the new lock's purpose. (more on the line) Do: Add a deterministic concurrent fixture that holds an admitted write while the drain starts, verifies that the drain waits, and then checks that a late write cannot reopen the stream.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L2: The production fix has not yet been checked in the matching ABI 98 Windows game runtime. When: The gameplay evidence uses ABI 95 builds, while this head targets ABI 98; the exact-head evidence is game-free. Do: Run the ABI 98 windowless game with tracing enabled, close through the stop window, and verify that the final rows are complete.
  • L3: The shared writer's Linux host build and runtime have not yet been checked. When: Linux now compiles the writer with the POSIX SRWLOCK shim and takes that lock for enabled traces; the fixture substitutes a C++ mutex instead of exercising that host integration. Do: Build the Linux host in a UTF-8 checkout and run with tracing enabled and disabled, confirming complete rows on normal close.

@fix can do L1.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: in two interleaved ABI 95 Windows runs per side, the stock builds missed at least 31 and 25 earlier rows, while both fixed runs retained every observed present. The exact-head game-free regression reports four rows on the base and five with the fix; exact-head ABI 98 gameplay remains untested.

Other systems: The writer also runs on Linux and on visible-window and control-bridge exits. The reported game-free checks cover those exit routes, but the native Linux build and runtime remain untested. The lock is used only when tracing is enabled; GPU rendering is not otherwise changed.

Switches: No switches added, changed or removed. HOS_PRESENT_TRACE remains disabled by default.

Reviewed: fbc988fb5f against e13b792f1a: Read the repository rules, PR template, standards, commits, diff, changed code and tests, and the relevant present and close call paths. Skimmed the broader nn_vi.c context and source-cutting helper. docs/review-checklist.md and the adjacent Tooling checkout were absent. No recorded run files or translations were changed.; nothing run (a code review).

Checked and fine:

  • The drain and writer protect the stream and seal with the same lock; draining before the first open prevents a late open.
  • The stop worker drains after the close work and before TerminateProcess; the existing watchdog remains active.
  • Both commits include AI-assistance trailers. No game-derived files, generated outputs, API version changes or third-party changes appear in the diff.
  • The reported Windows regression test removes the drain and reproduces the missing final row.

Testing: Read-only review; no commands from the project, builds or tests were run. The supplied CI checks are still running.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by futondestroyer. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The reported Windows gameplay runs show that the drain recovers the missing trace rows. The exact ABI 98 runtime and the shared writer on Linux still need the runs identified by the author before merge. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The windowless Windows stop now closes the present trace before terminating, preserving buffered rows and sealing the stream against later writes. The shared writer gains a lock when tracing is enabled; the committed tests cover the shutdown routes but do not exercise the writer and drain concurrently. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `tests/test_present_trace.py:245`: The checked-in shutdown tests never overlap a present write with the drain, so they do not protect the new lock's purpose. (more on the line) **Do:** Add a deterministic concurrent fixture that holds an admitted write while the drain starts, verifies that the drain waits, and then checks that a late write cannot reopen the stream. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: The production fix has not yet been checked in the matching ABI 98 Windows game runtime. *When:* The gameplay evidence uses ABI 95 builds, while this head targets ABI 98; the exact-head evidence is game-free. **Do:** Run the ABI 98 windowless game with tracing enabled, close through the stop window, and verify that the final rows are complete. - **L3**: The shared writer's Linux host build and runtime have not yet been checked. *When:* Linux now compiles the writer with the POSIX SRWLOCK shim and takes that lock for enabled traces; the fixture substitutes a C++ mutex instead of exercising that host integration. **Do:** Build the Linux host in a UTF-8 checkout and run with tracing enabled and disabled, confirming complete rows on normal close. `@fix` can do L1. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: in two interleaved ABI 95 Windows runs per side, the stock builds missed at least 31 and 25 earlier rows, while both fixed runs retained every observed present. The exact-head game-free regression reports four rows on the base and five with the fix; exact-head ABI 98 gameplay remains untested. **Other systems:** The writer also runs on Linux and on visible-window and control-bridge exits. The reported game-free checks cover those exit routes, but the native Linux build and runtime remain untested. The lock is used only when tracing is enabled; GPU rendering is not otherwise changed. **Switches:** No switches added, changed or removed. HOS_PRESENT_TRACE remains disabled by default. **Reviewed:** fbc988fb5f37 against e13b792f1ae6: Read the repository rules, PR template, standards, commits, diff, changed code and tests, and the relevant present and close call paths. Skimmed the broader nn_vi.c context and source-cutting helper. docs/review-checklist.md and the adjacent Tooling checkout were absent. No recorded run files or translations were changed.; nothing run (a code review). **Checked and fine:** - The drain and writer protect the stream and seal with the same lock; draining before the first open prevents a late open. - The stop worker drains after the close work and before TerminateProcess; the existing watchdog remains active. - Both commits include AI-assistance trailers. No game-derived files, generated outputs, API version changes or third-party changes appear in the diff. - The reported Windows regression test removes the drain and reproduces the missing final row. **Testing:** Read-only review; no commands from the project, builds or tests were run. The supplied CI checks are still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by futondestroyer. Nothing was run; a maintainer decides.</sub>
@ -179,4 +242,4 @@
check_csv(path)
else:
assert not path.exists(), "disabled trace created a file"
assert states[0] == states[1] == states[2], "tracing changed pacing/counters"
Member

L1 (should fix): The checked-in shutdown tests never overlap a present write with the drain, so they do not protect the new lock's purpose.

When: If the lock operations are removed while the seal remains, the sequential end-twice and end-first cases still pass, even though a stop can close the stream while another thread is writing to it.

Do: Add a deterministic concurrent fixture that holds an admitted write while the drain starts, verifies that the drain waits, and then checks that a late write cannot reopen the stream.

**L1** (should fix): The checked-in shutdown tests never overlap a present write with the drain, so they do not protect the new lock's purpose. *When:* If the lock operations are removed while the seal remains, the sequential end-twice and end-first cases still pass, even though a stop can close the stream while another thread is writing to it. **Do:** Add a deterministic concurrent fixture that holds an admitted write while the drain starts, verifies that the drain waits, and then checks that a late write cannot reopen the stream.
HumanBean changed title from WIP: fix(vi): drain the present trace on a Windows windowless stop to fix(vi): drain the present trace on a Windows windowless stop 2026-12-05 17:39:40 +00:00
HumanBean deleted branch fix/windows-present-trace-drain-e13 2026-12-05 17:39:49 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3266
No description provided.