Retain the last frame CSV rows when exiting normally #553
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!553
Loading…
Reference in a new issue
No description provided.
Delete branch "SmallDevBigNothing/Darner:codex/retain-final-frame-csv"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What it changes
The frame CSV writer buffers rows separately from the play log. The Windows title exit and F1 quit or restart can end the process before it writes the last row, which can hide the final hitch in a capture. Ask the writer to flush and wait up to 500 ms before these exits. A completed later flush also satisfies earlier callers.
How it was tested
96e7962againstc8258f9. Five fresh Windows processes per revision wrote the same final row with the real CSV writer and immediately calledTerminateProcess. Main retained 0/5 rows. The patched path retained 5/5, including present 42 and its 175.000 ms time.cargo test --locked -p darner-gpu --lib bench::tests::passed 8 tests.cargo test --locked -p darner-hle --lib closes_asked_of_the_window_end_the_titlepassed. Asset policy andgit diff --checkpassed.Checklist
main.docs/asset-policy.md.Checked for overlap
Tested merged onto
c8258f95(release), head3313399c. RTX 3090 24 GB, driver 621.24, i5-10600K, 32 GB, Windows 11.One unattended run with
DARNER_BENCH_CSVandDARNER_EXIT_AFTER_WORLD_S=60: code 0, the CSV has 3,076 rows and its lastelapsed_msis 166,633 (main: 3,530 rows, last 166,690), nodid not finish flushingline.One thing I noticed while reading the diff: the timed exit (
DARNER_EXIT_AFTER_WORLD_S) ends inexit_after_world()inhost.rs, which callsstd::process::exitafter a 400 ms sleep, so it does not go through the flush this PR adds. #491 changes that path (it calls the log flush andTerminateProcessthere). If the CSV should also be flushed on the timed exit, it may need a call there too. In my run the CSV looked complete, but one run does not show whether the tail can be lost.AI-assisted testing (Claude Code, Claude Opus 5.5); results and text reviewed by me.
Thanks for the RTX 3090 run. You traced the timed path correctly. Its 400 ms pause is on the present thread, while the separate CSV writer flushes every 250 ms.
I checked that path's timing with the real CSV writer from
3313399: I enqueued a known final row, waited 400 ms and calledstd::process::exit(0), with no explicit flush. Eight fresh processes all retained the final row (present=42,frame_ms=175.000), across four enqueue times relative to writer startup. This tests the delay under ordinary I/O. It doesn't establish a guarantee if the writer is stalled.I'll keep this PR focused on the title and F1 exits, where there is no timed pause. #491 preserves the pause. The flush helper here is available if timed exit needs an explicit acknowledgement as well.
[pr-fix] Retain the last frame CSV rows when exiting normallyto Retain the last frame CSV rows when exiting normallyTest needed — commit
3313399c; what to check: The frame CSV writer buffers rows separately from the play log. The Windows title exit and F1 quit or restart can end the process before it writes the last row, which can hide the final hitch in a capture. Ask the writer to flush and wait up to 500 ms before these exits. A completed later flush also satisfies earlier callers.Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.