umem: write the bind log on a dedicated thread #136
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory!136
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-136"
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?
@TheRifai on GitHub · 2026-12-01 20:18 UTC · original
TheRifai:bindlog-async→main· +98 −47 · 4 files · 1 commits · closed without mergingWhat
bindlog::lineandbindlog::flushedwrote the 64 KiB buffer to disk while holding the log mutex, so a slow disk blocked every thread logging a bind (docs/TASKS.md, "The bind log write under its lock stalls every thread for seconds"): the renderer, the descriptor helper, and the remapper's bind flush. The hot path now only appends to the buffer under the lock and hands full buffers to one dedicated writer thread. A failed hand-off is counted (umem::bindlog_dropped()) and shown on the stats line rather than waited on (rule 31). No Vulkan behaviour changes.The reference
No console counterpart: a diagnostic log must never change frame timing. The maintainer's two runs attributed 11,340.7 ms and 2,290.2 ms of renderer lock wait to
umem/src/bindlog.rs:46.Evidence
cargo check -p umem/-p vkback, 21 umem tests and 160 vkback tests, and the build all pass. Two new tests: a writer that sleeps 300 ms does not delay a line/flush (<100 ms), and a dropped writer increments the counter.UMEM_BINDLOG: a valid 45 MB log (806,856 lines),bind log buffers dropped 0, renderer lock waits0.7 mstotal (bindlog.rs:440.4 ms over 5 uncontended-ish waits), nobind log writespan on a hot thread.7131e3d: valid 53 MB log, renderer lock waits0.2 ms. The multi-second stall needs the maintainer's slow-disk/PSI conditions, which did not reproduce locally; the change removes the file write from under the lock by construction./tmp/opencode/capture/bindlog-async/,/tmp/opencode/capture/bindlog-main/.Checklist (docs/AGENTS.md)
docs/TASKS.mdnot edited (rule 29/31)unsafeor translator output changed (rules 2/9b/33/35/36/27)@TheRifai on GitHub · 2026-12-01 20:19 UTC · original
Superseded: main merged
8e558b7(#134, "umem: write the bind log on a writer thread, never block a caller") while this PR was open, and it now conflicts. Our implementation came from the same TASKS entry and has the same shape (dedicated writer thread, counted drops); the extra stats line and two unit tests here are not worth a rebase over the merged fix. Please close this one rather than merging; I won't close it myself.@vktory6 on GitHub · 2026-12-01 20:22 UTC · original
Thanks for saying so, and sorry for the overlap. #134 landed first, with the same shape. Closing as superseded, as you asked.
This is the third duplicate today (#130, #131, now this), because TASKS.md doesn't show who is on a task. We're working on a way to mark tasks as taken, so this stops happening.
If you want, the live drop counter in the stats line is still a useful small follow-up on top of #134. Right now #134 reports drops only at detach.
Pull request closed