Skip to content

fix(3ds): stop rewriting report.txt during play - #72

Merged
github-actions[bot] merged 1 commit into
masterfrom
fix/report-sd-writes-71
Nov 6, 2026
Merged

github-actions[bot] merged 1 commit into
masterfrom
fix/report-sd-writes-71

Conversation

@endercodezz

Copy link
Copy Markdown
Owner

What changed

On a slow SD card the background report.txt rewrite held up the game's ISO reads, which showed up as freezes every 5 s (#66). The file is no longer written periodically during play.

  • The bottom screen still updates every 5 s.
  • report.txt is written at the start of the run, on exit, and when the bottom screen is touched. The touch goes through the existing writer thread, and the game never sees it.
  • New report row: report : touch to save, N written. It replaces the blank row 5, so no other row moves.
  • An empty sdmc:/p3p3ds/report_live.txt restores the write every 5 s, for runs that end without an exit (a crash, a killed emulator). The Azahar notes in the n3ds-platform skill mention it.

Evidence

  • [VERIFIED] Same card and build on Tested 0.3.2 on real hardware #66: freezes with sd max 2656 ms, io 36, 64-74 % speed; no freezes with sd max 78 ms, io 0, 96-99 % speed.
  • [INFERRED] The reads wait behind the write. There is no per-second CSV of a run with freezes.

Verification

  • CTest 32/32 (Windows host); devkitARM build of p3p3ds.3dsx passes.
  • Azahar, unattended autotest, 1,500 vblanks:
    • default: report.txt changed only at the start and at the end (2 written);
    • with report_live.txt: every 5-6 s (6 written).

Not verified

  • [UNVERIFIED] Real hardware with a slow card. Azahar's SD writes take about 50 ms and speed was 83 % in both runs, so it cannot show the stall. This needs the reporter's confirmation on the next release.
  • [UNVERIFIED] The tap in a running game: a click posted to Azahar's windows did not reach the game. The tap uses the same write path as report_live.txt, and KEY_TOUCH in hidKeysDown was checked in the libctru source only.

Trade-off

A host crash now leaves only the start report (build, status : running) unless report_live.txt is present.

Closes #71
Refs #66

On a slow SD card a background rewrite took up to 2.6 s and the game's
ISO reads waited behind it: freezes every 5 s, 64-74 % speed, while a run
on the same card with 78 ms writes had none (#66). The bottom screen still
updates every 5 s, but report.txt is now written at the start, on exit and
when the bottom screen is touched. An empty report_live.txt restores the
write every 5 s for runs that end without an exit.

Verified: CTest 32/32; devkitARM build; Azahar autotest of 1,500 vblanks
writes the file only at the start and end (2 written), 6 times with
report_live.txt. Not verified: the tap in a real run, a slow card on
hardware.
@github-actions
github-actions Bot enabled auto-merge November 6, 2026 14:08
@github-actions
github-actions Bot merged commit bec4752 into master Nov 6, 2026
7 checks passed
@endercodezz
endercodezz deleted the fix/report-sd-writes-71 branch November 6, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3DS: periodic freezes on slow SD cards while report.txt is written (io 36 %)

1 participant