WIP: Preload window: log name in the doc, whole-line log writes, own path shortening, lossy reads #467
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!467
Loading…
Reference in a new issue
No description provided.
Delete branch "Jesper-A/Darner:up-preload-window-log-followups"
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?
Refs #215
What it changes
Follow-up to #215 (merged at
0cea71f11). It answers the small points of the review and the 125 % report. All changes are inapps/darner/src/preload_ui.rs.darner-preload-<time>.log; the file isdarner-preload-<time>-<pid>.log(review point 1: #215 (comment)). The doc is fixed, and a test checks the source for it.writeln!, which can write the text and the newline separately (review point 2). Now both share one handle behind a lock, and each line is built with its newline and written in onewrite_all(log_line). The child's own logger still appends through its own handle, so one of its lines can still land between two of ours. This only stops our two threads splitting each other's lines. A test runs two threads writing 500 lines each and checks that all 1000 come out whole.gof.logat 120 DPI, whileDT_PATH_ELLIPSISdid not shorten it (#215 (comment); review point 3). Now the window measures the text in the row's font (GetTextExtentPoint32W) and shortens the path itself (fit_path): the label at the start and the file name at the end stay, the middle becomes an ellipsis, and a file name too long for the row alone is cut from its left. A test checks this with one unit of width per character, including a wide-character label.lines().map_while(Result::ok)stopped at the first line that was not valid UTF-8, so the rest of the child's output was lost and its pipe left to fill.lossy_linesturns bad bytes into U+FFFD and reads to the end (a read error ends the stream). A test covers\r\n, bad bytes and a last line with no newline.The plan for these four was posted on #215 before the merge: #215 (comment)
How it was tested
up-preload-window-log-followups@d6e0adf91, based on main47d21cd3b.47d21cd3b. main is nowd91d8e4d6;git merge-treemerges the branch cleanly there. Not rebased, not re-tested on the new main (WIP).cargo clippy -p darner, with and without--all-features, and thedarnertests forpreload_ui, reported clean by the porter; exact flags and counts not kept. I did not re-run them for this text.--all-features) andcargo test --workspace --locked.WIP:comes off:fit_pathtests use a stand-in width, not the real font.)Spec dependence
Checklist
main: the follow-ups of one PR's review, all in one file.docs/asset-policy.md. (Text only.)Checked for overlap
apps/darner/src/preload_ui.rs. #458 has one hunk (about line 566, inmod window), roughly 35 to 55 lines from our nearest hunks. #450 has hunks around the stderr reader andrun(about lines 372 to 465 on main), several within a few lines of ours, so a textual conflict with #450 is possible. Line numbers come from each PR's own diff.This change was made with AI assistance (Claude Code).
I retested the exact 98-character path from my #215 report on
d6e0adf9110d353f53b07fe3b9ea4e05a9b7be34, Windows 11 build 26300.Path rendering. At 120 DPI in zh-CN (Microsoft YaHei UI), the baseline selected a 694 px string for a 685 px row. None of the final
g's 60 pixels appeared. This head shortened the string to 683 px, kept the filename and showed all 60 pixels. I also checked English and zh-CN at 96, 120 and 144 DPI with short, 98- and 260-character paths. All 18 rows on this head kept the label and full filename with no clipped ink. Six deliberately oversized basenames fitted by shortening from the left and keeping the suffix.The matrix used the real Win32 fonts and the PR's paint code in a memory DC. Captures from the hidden windows' paint buffers matched at 96 and 144 DPI. The final window blit returned 0 in this session; the 120-DPI result is an offscreen rendering, with no physical 125% desktop check.
Log streams. I compiled the actual
preload_ui::runfrom this head and its baseline into a standalone driver with a test child on native Windows pipes. Across six simultaneous stdout/stderr runs this head recorded all 196,662 expected lines, with no extras. It continued to parse progress after invalid UTF-8. The baseline lost subsequent progress in all three mixed-input runs.One small difference remains in
lossy_lines(line 386). On both streams the baseline preserved a payload carriage return intext\r\r\nand a bare\rat EOF; the new reader removes both. If log fidelity is intended, stripping only one LF and its optional preceding CR would preserve those payload bytes. These checks used generated input, without a game run.mygmailwasratelimited referenced this pull request2026-12-05 10:03:46 +00:00
d6e0adf911to97e0190672Closing this old-engine PR because post-merge has its own preload window (
apps/darner/src/preload.rs);preload_ui.rs, the window this fixes, is not in its tree. It can be redone there if the problem shows.Written with AI assistance (Claude Code).
Reopened: Main is the default branch again, so the close note above no longer applies.
Written with AI assistance (Claude Code).
WIP: [pr-fix][startup] Preload window: log name in the doc, whole-line log writes, own path shortening, lossy readsto WIP: Preload window: log name in the doc, whole-line log writes, own path shortening, lossy readsView 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.