Repository navigation
improved-20261124
Packet size fix and dirty-write headroom — improved persist build
A fork of SeanHeuc/CivSwitchFS at commit 0f7b361 (the pin used by SeanHeuc/civ-autoloader).
This build adds two small changes on top of improved-20261121.
What's new in this build
-
OperateRange packet size corrected (src/core/ipc/storage.js, src/core/ipc/filesystem.js)
The cache-invalidate commands (IStorage::OperateRange and IFile::OperateRange) declared 0x0C raw words for a 24-byte input.
The correct count is 0x0E: 0x10 bytes of padding + the 0x10-byte CMIF header + the 0x18-byte input, divided by 4.
This matches the libnx cmifMakeRequest formula and every other call site in the tree.
The old value caused no observed failure, because fsp-srv does not truncate the input struct at the declared count.
Both call sites now declare 0x0E. -
Dirty file size reduced (src/core/config.mjs)
DIRTY_FILE_SIZE goes from 0x800000 (8 MiB) to 0x700000 (7 MiB).
This leaves 1 MiB of headroom under the BC save-data cap for metadata and other outstanding data.
The scratch tree is already committed at setup time in this lineage, so its metadata is flushed before the race begins.
Unchanged: timing learning (the XCFG record in the save), the bounded-IPC freeze fix, and the retry-reliability port from improved-20261121 work exactly as before.
The attempt budget (10, up to 30), the delay tables, and the wave budgets are unchanged from upstream.
Status: built from source and verified at the source and payload level.
These two changes have NOT yet been verified on real hardware.
To use this build, reinstall the autoloader save once; reinstalling resets the timing record.
Reinstall with improved-20261121 to go back.
Changed files vs upstream 0f7b361 (cumulative)
- 2026-11-17 improvements: src/core/timing-slot.mjs (new), src/core.js, src/core/autoloader.mjs, persist/save-codec.js, src/core/ipc/transport.js
- improved-20261121: src/core/helpers/cache.mjs, src/core/steps/cleanup.mjs, src/core/steps/campaign.mjs, src/core/ipc/filesystem.js, src/core.js
- This build: src/core/ipc/storage.js, src/core/ipc/filesystem.js, src/core/config.mjs
Build
- persist-bootstrap.js sha256 9fbc59bef8ba6ca053817fd524a88678b0230fd7b430358cb6a511d578087cbb
- save-template.bin sha256 32fa8a0d6dd0a480d8e541e63ea44c4619bc6f7be4282cfc3cb6a4f6d305dfae (unchanged from upstream)
Credits
Original work: SeanHeuc (CivSwitchFS / civ-autoloader), Gezine (CivSwitch).
Retry design reference: s8n (CivSwitchFS-kaiHEN).
Packet-size and dirty-size references: ItsNerisma (CivSwitchFS).
Same license as upstream.
パケットサイズの修正とダーティ書き込みの余裕 — 改良版 persist ビルド
SeanHeuc/CivSwitchFS(civ-autoloader が使うピン 0f7b361)のフォークです。
improved-20261121 の上に、小さな変更を2点加えました。
今回の変更
-
OperateRange のパケットサイズを修正(src/core/ipc/storage.js、src/core/ipc/filesystem.js)
キャッシュ無効化の命令(IStorage::OperateRange と IFile::OperateRange)が、24バイトの入力に対して 0x0C 語と宣言していました。
正しいのは 0x0E 語です。
パディング 0x10 バイト + CMIF ヘッダ 0x10 バイト + 入力 0x18 バイトを4で割った値です。
libnx の cmifMakeRequest の計算式と、ツリー内の他の全ての呼び出しと一致します。
古い値でも失敗した形跡はありません。
本体側が宣言された語数で入力を切り捨てていないためです。
両方の呼び出しを 0x0E に揃えました。 -
ダーティファイルのサイズを縮小(src/core/config.mjs)
DIRTY_FILE_SIZE を 0x800000(8MiB)から 0x700000(7MiB)にしました。
BC セーブデータの上限に対して、メタデータなどの分として 1MiB の余裕を残します。
スクラッチツリーのセットアップ時 commit は、この系統では以前から入っています。
そのためメタデータはレース開始前にフラッシュされます。
タイミング学習(セーブ内 XCFG 記録)、フリーズ修正、improved-20261121 のリトライ信頼性の移植は、そのままです。
アテンプト数(10回、最大30回)、遅延テーブル、ウェーブ数は upstream から変更していません。
状態:ソースとペイロードのレベルで検証済みです。
今回の2点は実機未検証です。
使うにはオートローダーのセーブを1回入れ直してください。
入れ直すとタイミング学習の記録は初期化されます。
戻すときは improved-20261121 で入れ直してください。