[pr-fix][startup] play: a question given up on no longer takes the next question's answer (first-start offer, then DLSS/FSR/MFG) #265
Loading…
Reference in a new issue
No description provided.
Delete branch "iboom72/fix/play-one-console-reader"
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
apps/darner/src/play.rs,offer_auto_detect, since85c11db9, the commit that made the offer give up after 20 s).The first-start question "Apply them now? [Y/n]" reads its answer on a thread and gives up after 20 s. That thread is never stopped: it stays in
read_lineand holds the console's input. Every later question of the same start reads the console itself, so the first line the player types goes to the old thread and is thrown away, and the question keeps waiting for a second line.The questions that can follow in the same start are the NVIDIA files (
offer_dlss), the AMD files (offer_fsr), MFG Unlocker (offer_mfg), and "press Enter to close" after a failed start (hold_window). The first two take an empty line as yes: a player who typesn, sees nothing happen and presses Enter again gets the download they declined, and nodeclinedmark is written.A start that can reach it: a new install started by double click (a console of its own, no settings file), nobody answers within 20 s, the default
--dlss qualityplans DLSS and the NVIDIA files are missing.What this does: every question in
play.rsnow asks one helper,answer. A read that was given up on is kept, and the next question takes its line instead of starting a second read. A line that arrived before the next question was shown is dropped (it was typed for the old question). A question without a time limit still reads on the calling thread, as before, when no earlier read is waiting. No thread loops on the console.The Agility SDK question in
check_shader_modelruns before the offer and was not affected; it uses the helper too, so the order of the questions can change later.main.rs's own read runs beforeprepareand is left alone.How it was tested
98a3c911cargo test -p darner --locked: passed (149 passed, 1 ignored in the app's unit tests, with the newa_question_given_up_on_does_not_take_the_next_answer; 2 + 2 + 8 in its three test files).cargo clippy -p darner --all-targets --locked -- -D warnings: passed.cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features: both passed.cargo test --workspace --lockedwas not run as a whole (only-p darner, above; the change is inapps/darneronly).Checklist
main.docs/asset-policy.md.Not run in the game: the questions come up only at a first start without a settings file and without the NVIDIA or AMD files, and need 20 s without an answer.
Checked for overlap
apps/darner/src/play.rs(#243, #233, #222, #216, #215, #205, #154, #153, #143, #140, #130, #80, #75, #59, #16, #12, #9); none of their diffs touches these questions.🤖 Generated with Claude Code
Tested the input handling on Windows in 12 private console processes, using the launcher’s input code from
f3840d73and98a3c911with the original 20-second timeout.After the first question timed out, I sent
nand Enter once after the second prompt appeared. On main, the second question stayed open. Sending another Enter then selected the default yes. On the PR, the same singlenand Enter declined immediately.With two lines sent together after the second prompt (
ntheny), the PR correctly deliverednto the second question andyto the third. There is one shared boundary: when two complete lines (oldtheny) were already queued before the second prompt, both revisions consumedyas its answer immediately. A single stale line followed by a freshnbehaved as expected on the PR.The harness used the Windows console line reader and an isolated input buffer. It did not run the full launcher or download an SDK.
Follow-up to "How it was tested": the description says
cargo test --workspace --lockedwas not run as a whole. It has now been run, together with five other small pull requests of mine, on one local branch.mainf3840d73with these six commits picked on top, no conflicts:98a3c911(#265),5799f84a(#270),c782a6e2(#283),e69c0f77(#284),1c142d36(#285),5eae3d19(#286). Not run on this pull request's branch alone.cargo clippy --workspace --all-targets --locked -- -D warnings: passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed.cargo test --workspace --locked: one test failed, indarner-shader:emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders("DXIL validation failed ... Not all elements of output SV_Depth were written"). The same test fails the same way onmainf3840d73without these commits, none of the six changesdarner-shader, and #227 (open) fixes it.darner-shader's other tests: 557 passed, 16 ignored.cargo test --workspace --locked --no-fail-fast --exclude darner-shader: passed, all packages and the doc tests (darner-gpu: 1,773 passed, 81 ignored).Still not run in the game.
@superhero-520 wrote in #265 (comment):
Pushed
9d3ede12for this case. When the read that was given up on already has its line by the time the next question is asked, that line is dropped as before, and the read that follows now clears the console's input first (FlushConsoleInputBuffer). Soyin your case is dropped too, and the question waits for a line typed after it was shown.What stays as it was:
How it was tested
9d3ede12(98a3c911plus this commit, onmainf3840d73).cargo test -p darner --locked: passed (149 passed, 1 ignored in the app's unit tests; 2 + 2 + 8 in its three test files).a_question_given_up_on_does_not_take_the_next_answernow also checks that the read after a dropped line is told to drop the rest.cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features: both passed.cargo test --workspace --lockedwas not run again for this commit (only-p darner; the change is inapps/darner/src/play.rsonly).FlushConsoleInputBuffer. If you can run your harness on9d3ede12with theoldthenycase, that would cover it.The description above still names
98a3c911as the tested revision.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.