WIP: [pr-feature] F1 ZIP LOGS FOR A BUG REPORT and darner zip-logs: one zip of the newest logs, user folder hidden #146

Draft
Jesper-A wants to merge 2 commits from Jesper-A/Darner:up-log-zip into main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

Players who report a problem paste or attach play logs of 8 MB and more. Those are too big for paste sites, and they contain the player's user folder (C:\Users\<name>\...). This adds one zip that fixes both: it is small, it attaches straight to Fluxer or to an issue, and the user folder and user name are hidden in it.

New for the player:

  • F1, PAGE: TOOLS, ZIP LOGS FOR A BUG REPORT. It makes darner-logs-<date>-<time>.zip in reports (in %LOCALAPPDATA%\darner, or in DARNER_HOME) and opens File Explorer with the zip picked. The zip is made on a thread of its own, so the game keeps drawing.
  • darner.exe zip-logs, the same thing outside the game (for example after a crash). It prints what went into the zip and where it is (and "No log file is in the zip." if no log made it).
  • README: the "Reporting a problem?" box now names the zip first. Attaching both logs by hand stays as the fallback. The F1 actions list has the new row.

What is in the zip: the newest play log (this run's log if there is one), and per title crashes.log and the newest *.crash.log. Nothing else: no saves, settings, shaders or game files. A log over 200 MB goes in as its last 64 MB (from a whole line when it has one), and a README.txt in the zip says so. The zip is deflate level 9 and written under a .part name first, so a half-written zip is never seen.

What is hidden: in the zipped copies, the user's folder (%USERPROFILE%) is written as %USERPROFILE%, and Users\<name> without the drive as Users\%USERNAME%. It matches \, / and \\, in any case, and only a whole name (Sammy is not Sam). The logs on the PC are not changed. No log line is known to write the machine name; the one place that could (crates/darner-hle/src/modules/net.rs, once) prints <pc>.

Code: the zip writer of save_share.rs moves to a new zip.rs, re-indented, with a new write_packed(.., level); write calls it at level 6, so save_share output is the same. save_share::now and dos_now become pub(crate), and the new log_zip.rs uses them.

There is no DARNER_* switch: it is an action the player starts, not a changed default. Nothing runs unless the player picks the row or runs the subcommand.

Credit: ported from our own fork's commit 3a0f490a3 (pr4-log-zip); same author as this PR.

Refs: none. There is no issue for this; none was opened just to fill the line.

How it was tested

  • Tested revision: 31ea50416 (on top of cdc8c755a, which is on main 57dea7f23). The 63-test run below was on cdc8c755a; on 31ea50416 I re-ran only the log_zip lib tests (5 passed) and the workspace clippy.
  • Commands and results (run on that commit; there is no CI upstream):
    • cargo test --locked -p darner-gpu -j 4 --lib -- log_zip zip save_share host::menu: 63 passed, 2 ignored.
    • cargo clippy --workspace --all-targets --locked -j 4 -- -D warnings (gate 1): clean (also on 31ea50416).
    • cargo xtask policy: 555 files ok.
  • Gate 2 (cargo clippy ... --all-features ...) and gate 3 (cargo test --workspace --locked, the whole workspace) were not run on this commit. Only the narrower test filter above ran.
  • What the tests cover: a made-up log comes back whole from the zip and packs to under a tenth; only the newest play and crash logs are picked and a non-log is never taken; a log over the cap comes as its tail (the returned names and the README note are checked) and "no logs" is an error; the user folder and name are hidden in the copies and the files on disk stay as they were; the zip's name; the F1 row's help text fits the menu width.
  • Gameplay, when relevant: not tested in the game.
  • Before and after: not applicable (no frame-rate or rendering change).
  • Shader wave sizes tested: not applicable.
  • Coverage gaps (open, and the reason this is WIP):
    • The F1 row in a running game: that it appears under PAGE: TOOLS, is highlighted and runs.
    • File Explorer opening with the zip picked, from F1 and from darner.exe zip-logs.
    • A real zip from a real play log and crash log, opened with Windows' own zip support and with another tool. The README's "about a tenth of their size" rests on the made-up log in the unit test, not on a real play log.
    • The CLI and F1 on a real log over 200 MB (only a small-limit unit test so far).
    • Drop the stale references from the old host in log_zip.rs (the #98 quota remark, the spam.yml mention and the spam-word test).
    • Also not run: gates 2 and 3 above.

Spec dependence

Likely general. It reads files and writes a zip; it does not touch the GPU, shaders or the title's memory, so it should not depend on the GPU, driver or console profile. It was written on a PC with an RTX 2070 SUPER (Windows 11); the unit tests do not need a GPU. Untested elsewhere: other Windows versions, a LOCALAPPDATA on a network or redirected drive, and a user folder whose name has non-ASCII letters (the match is on the bytes of the name; the test names are ASCII).

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md. (cargo xtask policy: 555 files ok.)
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: no open PR does the same job (searched "zip logs", "log zip", "zip-logs", "bug report logs", open and closed). Open PRs that touch the same files, with a trial merge (git merge-tree --write-tree) of this commit against each PR head:
    • Merge cleanly: #143 (F1 ASPECT RATIO row), #80 (DLSS 5 rows), #75 (F1 ULTRAWIDE row), #145 (menu help text and README), #142 and #140 (README; #140 also main.rs), #130 (main.rs), #118 and #110 (README), #59, #37, #36, #34.
    • Conflicts with this PR on top of its own: #47 (XeSS Super Resolution): one adjacent-line conflict in apps/darner/src/main.rs, where both add to the Command::UpscalerCheck area. It is a one-line resolution for whichever merges second.
    • Already conflict with main on their own, and nothing is added by this PR: #48, #9, #10, #12, #14, #15, #16, #17, #18.
    • Not checked: the other open PRs do not touch these files.

Drafted with AI assistance (Claude Code).

<!-- Draft until the five open boxes under "Coverage gaps" are ticked. --> ## Contributor role (optional) - Fluxer ID: <!-- to be filled in by the contributor --> ## What it changes Players who report a problem paste or attach play logs of 8 MB and more. Those are too big for paste sites, and they contain the player's user folder (`C:\Users\<name>\...`). This adds one zip that fixes both: it is small, it attaches straight to Fluxer or to an issue, and the user folder and user name are hidden in it. New for the player: - **F1, PAGE: TOOLS, ZIP LOGS FOR A BUG REPORT.** It makes `darner-logs-<date>-<time>.zip` in `reports` (in `%LOCALAPPDATA%\darner`, or in `DARNER_HOME`) and opens File Explorer with the zip picked. The zip is made on a thread of its own, so the game keeps drawing. - **`darner.exe zip-logs`**, the same thing outside the game (for example after a crash). It prints what went into the zip and where it is (and "No log file is in the zip." if no log made it). - **README**: the "Reporting a problem?" box now names the zip first. Attaching both logs by hand stays as the fallback. The F1 actions list has the new row. What is in the zip: the newest play log (this run's log if there is one), and per title `crashes.log` and the newest `*.crash.log`. Nothing else: no saves, settings, shaders or game files. A log over 200 MB goes in as its last 64 MB (from a whole line when it has one), and a `README.txt` in the zip says so. The zip is deflate level 9 and written under a `.part` name first, so a half-written zip is never seen. What is hidden: in the zipped copies, the user's folder (`%USERPROFILE%`) is written as `%USERPROFILE%`, and `Users\<name>` without the drive as `Users\%USERNAME%`. It matches `\`, `/` and `\\`, in any case, and only a whole name (`Sammy` is not `Sam`). The logs on the PC are not changed. No log line is known to write the machine name; the one place that could (`crates/darner-hle/src/modules/net.rs`, `once`) prints `<pc>`. Code: the zip writer of `save_share.rs` moves to a new `zip.rs`, re-indented, with a new `write_packed(.., level)`; `write` calls it at level 6, so `save_share` output is the same. `save_share::now` and `dos_now` become `pub(crate)`, and the new `log_zip.rs` uses them. There is no `DARNER_*` switch: it is an action the player starts, not a changed default. Nothing runs unless the player picks the row or runs the subcommand. Credit: ported from our own fork's commit `3a0f490a3` (pr4-log-zip); same author as this PR. Refs: none. There is no issue for this; none was opened just to fill the line. ## How it was tested - Tested revision: `31ea50416` (on top of `cdc8c755a`, which is on `main` `57dea7f23`). The 63-test run below was on `cdc8c755a`; on `31ea50416` I re-ran only the `log_zip` lib tests (5 passed) and the workspace clippy. - Commands and results (run on that commit; there is no CI upstream): - `cargo test --locked -p darner-gpu -j 4 --lib -- log_zip zip save_share host::menu`: 63 passed, 2 ignored. - `cargo clippy --workspace --all-targets --locked -j 4 -- -D warnings` (gate 1): clean (also on `31ea50416`). - `cargo xtask policy`: 555 files ok. - Gate 2 (`cargo clippy ... --all-features ...`) and gate 3 (`cargo test --workspace --locked`, the whole workspace) were **not run** on this commit. Only the narrower test filter above ran. - What the tests cover: a made-up log comes back whole from the zip and packs to under a tenth; only the newest play and crash logs are picked and a non-log is never taken; a log over the cap comes as its tail (the returned names and the README note are checked) and "no logs" is an error; the user folder and name are hidden in the copies and the files on disk stay as they were; the zip's name; the F1 row's help text fits the menu width. - Gameplay, when relevant: not tested in the game. - Before and after: not applicable (no frame-rate or rendering change). - Shader wave sizes tested: not applicable. - Coverage gaps (open, and the reason this is WIP): - [ ] The F1 row in a running game: that it appears under PAGE: TOOLS, is highlighted and runs. - [ ] File Explorer opening with the zip picked, from F1 and from `darner.exe zip-logs`. - [ ] A real zip from a real play log and crash log, opened with Windows' own zip support and with another tool. The README's "about a tenth of their size" rests on the made-up log in the unit test, not on a real play log. - [ ] The CLI and F1 on a real log over 200 MB (only a small-limit unit test so far). - [ ] Drop the stale references from the old host in `log_zip.rs` (the #98 quota remark, the `spam.yml` mention and the spam-word test). - Also not run: gates 2 and 3 above. ## Spec dependence Likely general. It reads files and writes a zip; it does not touch the GPU, shaders or the title's memory, so it should not depend on the GPU, driver or console profile. It was written on a PC with an RTX 2070 SUPER (Windows 11); the unit tests do not need a GPU. Untested elsewhere: other Windows versions, a `LOCALAPPDATA` on a network or redirected drive, and a user folder whose name has non-ASCII letters (the match is on the bytes of the name; the test names are ASCII). ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. (`cargo xtask policy`: 555 files ok.) - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: no open PR does the same job (searched "zip logs", "log zip", "zip-logs", "bug report logs", open and closed). Open PRs that touch the same files, with a trial merge (`git merge-tree --write-tree`) of this commit against each PR head: - Merge cleanly: #143 (F1 ASPECT RATIO row), #80 (DLSS 5 rows), #75 (F1 ULTRAWIDE row), #145 (menu help text and README), #142 and #140 (README; #140 also `main.rs`), #130 (`main.rs`), #118 and #110 (README), #59, #37, #36, #34. - Conflicts with this PR on top of its own: #47 (XeSS Super Resolution): one adjacent-line conflict in `apps/darner/src/main.rs`, where both add to the `Command::UpscalerCheck` area. It is a one-line resolution for whichever merges second. - Already conflict with `main` on their own, and nothing is added by this PR: #48, #9, #10, #12, #14, #15, #16, #17, #18. - Not checked: the other open PRs do not touch these files. Drafted with AI assistance (Claude Code).
The newest play log, crashes.log and the newest crash log go into
reports\darner-logs-<date>-<time>.zip (deflate 9), with the user's folder
and name hidden in the copies; File Explorer opens on the zip. The zip
writer of save_share moves to zip.rs unchanged. README names the zip first.

Port of our fork commit 3a0f490a3 (pr4-log-zip); author credited.

This change was made with AI assistance (Claude Code).
Jesper-A changed title from WIP: [pr-feature] F1 ZIP LOGS FOR A BUG REPORT and darner zip-logs: one zip of the newest logs, user folder hidden to [pr-feature] F1 ZIP LOGS FOR A BUG REPORT and darner zip-logs: one zip of the newest logs, user folder hidden 2026-12-04 00:19:30 +00:00
First-time contributor

Tested cdc8c755 on Windows (release, --locked): build OK; cargo test -p darner green (144 passed, 1 ignored); all 5 new log_zip tests pass. darner zip-logs wrote reports\darner-logs-20261204-010416.zip (1,607 KB): newest play log (11.9 MB -> 1.64 MB packed) + README.txt. In the zip: 0 hits for the user name or C:\Users<user> (21 paths as %USERPROFILE%); the logs on disk are unchanged. No crashes.log/crash log existed here, so those entries were only covered by unit tests. F1 menu path not tested (no game launch). One unrelated watch:: test flaked in the full parallel darner-gpu run and passes in isolation.

Drafted with AI assistance (OpenCode).

Tested cdc8c755 on Windows (release, --locked): build OK; `cargo test -p darner` green (144 passed, 1 ignored); all 5 new log_zip tests pass. `darner zip-logs` wrote reports\darner-logs-20261204-010416.zip (1,607 KB): newest play log (11.9 MB -> 1.64 MB packed) + README.txt. In the zip: 0 hits for the user name or C:\Users\<user> (21 paths as %USERPROFILE%); the logs on disk are unchanged. No crashes.log/crash log existed here, so those entries were only covered by unit tests. F1 menu path not tested (no game launch). One unrelated watch:: test flaked in the full parallel darner-gpu run and passes in isolation. Drafted with AI assistance (OpenCode).
Contributor

One case the existing oversized-file test exposes on cdc8c755: log_zip::write() skips darner-play-big.log and the ZIP only contains README.txt. log_zip::make() reports names from the original selection, so the CLI would print in the zip: darner-play-big.log and offer a ZIP with no log. Could write() return the log names actually written and have CLI/F1 signal explicitly when the list is empty? The existing oversized-file test can assert the returned names as well. This is from source review of the test and its callers. Writer and returned names · Test

One case the existing oversized-file test exposes on `cdc8c755`: `log_zip::write()` skips `darner-play-big.log` and the ZIP only contains `README.txt`. `log_zip::make()` reports names from the original selection, so the CLI would print `in the zip: darner-play-big.log` and offer a ZIP with no log. Could `write()` return the log names actually written and have CLI/F1 signal explicitly when the list is empty? The existing oversized-file test can assert the returned names as well. This is from source review of the test and its callers. [Writer and returned names](https://git.gtahub.st/Jesper-A/Darner/src/commit/cdc8c755a66248e1e1524c9e70e0382838357c89/crates/darner-gpu/src/log_zip.rs#L150-L193) · [Test](https://git.gtahub.st/Jesper-A/Darner/src/commit/cdc8c755a66248e1e1524c9e70e0382838357c89/crates/darner-gpu/src/log_zip.rs#L266-L277)
First-time contributor

Reproduced the oversized-file case on cdc8c755 (Windows): a temp DARNER_HOME with a 201 MiB darner-play-big.log (over MOST = 200 MiB), then darner zip-logs prints in the zip: darner-play-big.log but the zip holds only README.txt (75 bytes, the left-out note). Confirmed in code: write() skips the oversized file (log_zip.rs:157) while make() returns the original selection (log_zip.rs:192). Returning the written names from write() and having CLI/F1 say when the list is empty, with the oversized-file test asserting the returned names, would cover it.

Drafted with AI assistance (OpenCode).

Reproduced the oversized-file case on cdc8c755 (Windows): a temp DARNER_HOME with a 201 MiB darner-play-big.log (over MOST = 200 MiB), then `darner zip-logs` prints `in the zip: darner-play-big.log` but the zip holds only README.txt (75 bytes, the left-out note). Confirmed in code: write() skips the oversized file (log_zip.rs:157) while make() returns the original selection (log_zip.rs:192). Returning the written names from write() and having CLI/F1 say when the list is empty, with the oversized-file test asserting the returned names, would cover it. Drafted with AI assistance (OpenCode).
A play log over 200 MB was left out and the zip held only README.txt,
while make() still reported the names it was given. Now such a log goes
in as its last 64 MB (from a whole line on) with a note in README.txt,
and write() returns the names it really put in the zip.

Reported by tyr0nsur on PR #146.

This change was made with AI assistance (Claude Code).
Author
Contributor

Thanks @tyr0nsur for the review, and thanks m3m3dub5 for the test report and the repro.

What was wrong: write() skipped any log over the 200 MB cap, so the ZIP held only README.txt, and make() returned the names it was given instead of the names written. The CLI could print in the zip: darner-play-big.log for a ZIP with no log. You were right.

New commit 31ea50416 (on top of cdc8c755):

  • write() returns the names it actually put in the ZIP, and make() passes them on. This is your suggestion. The oversized test now asserts the returned names.
  • The CLI prints "No log file is in the zip." when that list is empty. F1 only writes a warning to the log and shows nothing on screen. Both are a guard that cannot fire today, because of the next point.
  • The tail is our own choice, beyond what you asked: an oversized log is no longer left out. Its last 64 MB goes in under the same name, starting on a whole line when it has one, and README.txt says so. The crash is at the end of a log, so this keeps it useful. If you would rather have it left out and named, or a different size, say so and I will change it.

Gates run: the log_zip lib tests (5 passed) and cargo clippy --workspace --all-targets --locked -- -D warnings (clean). Not run: --all-features clippy, cargo test --workspace, the CLI on a real oversized file, F1 in game.

Drafted with AI assistance (Claude Code).

Thanks @tyr0nsur for the review, and thanks m3m3dub5 for the test report and the repro. What was wrong: `write()` skipped any log over the 200 MB cap, so the ZIP held only README.txt, and `make()` returned the names it was given instead of the names written. The CLI could print `in the zip: darner-play-big.log` for a ZIP with no log. You were right. New commit `31ea50416` (on top of `cdc8c755`): - `write()` returns the names it actually put in the ZIP, and `make()` passes them on. This is your suggestion. The oversized test now asserts the returned names. - The CLI prints "No log file is in the zip." when that list is empty. F1 only writes a warning to the log and shows nothing on screen. Both are a guard that cannot fire today, because of the next point. - The tail is our own choice, beyond what you asked: an oversized log is no longer left out. Its last 64 MB goes in under the same name, starting on a whole line when it has one, and README.txt says so. The crash is at the end of a log, so this keeps it useful. If you would rather have it left out and named, or a different size, say so and I will change it. Gates run: the `log_zip` lib tests (5 passed) and `cargo clippy --workspace --all-targets --locked -- -D warnings` (clean). Not run: `--all-features` clippy, `cargo test --workspace`, the CLI on a real oversized file, F1 in game. Drafted with AI assistance (Claude Code).
Jesper-A changed title from [pr-feature] F1 ZIP LOGS FOR A BUG REPORT and darner zip-logs: one zip of the newest logs, user folder hidden to WIP: [pr-feature] F1 ZIP LOGS FOR A BUG REPORT and darner zip-logs: one zip of the newest logs, user folder hidden 2026-12-04 02:24:43 +00:00
First-time contributor

Re-tested 31ea504 with the same repro: fixed. A 201 MiB darner-play-big.log is now kept as its tail in the zip (README: 'only its last 64 MB is here, from a whole line when it has one'), the CLI names match the zip contents, and with a marker file the entry contains END-MARKER but not START-MARKER. The small-log case is unchanged (named and included).

Drafted with AI assistance (OpenCode).

Re-tested 31ea504 with the same repro: fixed. A 201 MiB darner-play-big.log is now kept as its tail in the zip (README: 'only its last 64 MB is here, from a whole line when it has one'), the CLI names match the zip contents, and with a marker file the entry contains END-MARKER but not START-MARKER. The small-log case is unchanged (named and included). Drafted with AI assistance (OpenCode).
Owner

Second-opinion review: the oversized-log fix in 31ea50416 is right (tail of 64 MB from a whole line, the README in the zip says so, write() returns what it wrote, the CLI says when no log is in), and a tester confirmed it. Before merging:

  1. F1 zip_logs always shows "FILE EXPLORER OPENS WITH THE ZIP", even when the zip failed or holds no log; the failure only goes to the log file. Show it on screen.
  2. The privacy claim is stronger than the code: 8.3 short paths (C:\Users\NAME~1) and the user name outside a path are not replaced. Say "the user folder in paths" instead of "the user name".
    Optional: in game, a log just under 200 MB is read whole and copied again by hide_profile, a few hundred MB extra in the game process for a moment. A lower in-game cap would avoid it. The F1 label and CLI help are English only.
Second-opinion review: the oversized-log fix in 31ea50416 is right (tail of 64 MB from a whole line, the README in the zip says so, `write()` returns what it wrote, the CLI says when no log is in), and a tester confirmed it. Before merging: 1. F1 `zip_logs` always shows "FILE EXPLORER OPENS WITH THE ZIP", even when the zip failed or holds no log; the failure only goes to the log file. Show it on screen. 2. The privacy claim is stronger than the code: 8.3 short paths (`C:\Users\NAME~1`) and the user name outside a path are not replaced. Say "the user folder in paths" instead of "the user name". Optional: in game, a log just under 200 MB is read whole and copied again by `hide_profile`, a few hundred MB extra in the game process for a moment. A lower in-game cap would avoid it. The F1 label and CLI help are English only.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'up-log-zip:Jesper-A-up-log-zip'
git switch 'Jesper-A-up-log-zip'

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.

git switch 'main'
git merge --no-ff 'Jesper-A-up-log-zip'
git switch 'Jesper-A-up-log-zip'
git rebase 'main'
git switch 'main'
git merge --ff-only 'Jesper-A-up-log-zip'
git switch 'Jesper-A-up-log-zip'
git rebase 'main'
git switch 'main'
git merge --no-ff 'Jesper-A-up-log-zip'
git switch 'main'
git merge --squash 'Jesper-A-up-log-zip'
git switch 'main'
git merge --ff-only 'Jesper-A-up-log-zip'
git switch 'main'
git merge 'Jesper-A-up-log-zip'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
4 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
TrustNo1/Darner!146
No description provided.