Skip to content

Releases

stock-20261125b

Choose a tag to compare

@yyoossk yyoossk released this 24 Nov 15:47

The stock upstream CivSwitchFS payload (stock-20261125) plus only the two changes that improved-20261124 added.
The cache-invalidate command (OperateRange) now declares the correct packet size, 0x0E words instead of 0x0C.
The dirty file is now 7 MiB instead of 8 MiB.
No other fork improvements are included: no timing learning, no freeze fix, no retry changes.
The save installer also adds the save-folder creation, so it can install on consoles whose save data has no saves/Single folder.
This release is one step of the start-up failure diagnosis.

純正の upstream CivSwitchFS ペイロード (stock-20261125) に、improved-20261124 で追加した2点だけを足したものです。
キャッシュ無効化の命令 (OperateRange) のパケットサイズが、正しい 0x0E 語になりました (従来は 0x0C 語)。
ダーティファイルが 8MiB から 7MiB になりました。
それ以外のフォークの改良は入っていません (タイミング学習なし、フリーズ修正なし、リトライ変更なし)。
セーブのインストーラーにはフォルダ作成も追加してあり、saves/Single フォルダが無い本体にも入れられます。
起動失敗の切り分けの一手です。

stock-20261125

Choose a tag to compare

@yyoossk yyoossk released this 24 Nov 15:41

The completely stock upstream CivSwitchFS payload (SeanHeuc/CivSwitchFS), built from the pinned upstream source.
None of this fork's improvements are included: no timing learning, no freeze fix, no retry changes.
Only the save installer adds the save-folder creation, so it can install on consoles whose save data has no saves/Single folder.
This release exists to diagnose a start-up failure: the same console fails at the first step with every improved payload, and this build checks whether the stock payload behaves the same.

純正の upstream CivSwitchFS ペイロード (SeanHeuc/CivSwitchFS) を、固定した upstream ソースからビルドしたものです。
このフォークの改良は一切入っていません (タイミング学習なし、フリーズ修正なし、リトライ変更なし)。
セーブのインストーラーだけ、saves/Single フォルダが無い本体にも入れられるようフォルダ作成を追加しています。
起動失敗の切り分け用です。
改良版ペイロードでは毎回最初の段階で止まる本体で、純正ペイロードでも同じになるかを確認します。

improved-20261124b

Choose a tag to compare

@yyoossk yyoossk released this 24 Nov 14:14

Installer fix: create the game's save folders when they are missing.
When the console's Civilization VII save data has no saves/Single folder, installing the autoloader save failed at the file creation step with "create : 0x202" (PathNotFound).
The installer now creates save:/saves and save:/saves/Single first when they are missing.
Creating them is a no-op when they already exist.
The payload that runs at Load Game is unchanged from improved-20261124 (same payload SHA-256).
Verified at the source and payload level only.
Not yet verified on real hardware.

インストーラーの修正です。
ゲームのセーブフォルダが無い場合に、フォルダを作るようにしました。
本体のシヴィライゼーション7のセーブデータに saves/Single フォルダが無いと、オートローダーセーブのインストールがファイル作成の段階で「create : 0x202」(PathNotFound) となり失敗していました。
不足している場合は、まず save:/saves と save:/saves/Single を作成してから書き込むようにしました。
既にある場合は何もしません。
「ゲームをロード」で動くペイロード自体は improved-20261124 から変更ありません (ペイロードの SHA-256 も同一です)。
検証はソースとペイロードのレベルのみです。
実機での確認はまだです。

improved-20261124

Choose a tag to compare

@yyoossk yyoossk released this 24 Nov 12:41

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

  1. 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.

  2. 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点加えました。

今回の変更

  1. 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 に揃えました。

  2. ダーティファイルのサイズを縮小(src/core/config.mjs)
    DIRTY_FILE_SIZE を 0x800000(8MiB)から 0x700000(7MiB)にしました。
    BC セーブデータの上限に対して、メタデータなどの分として 1MiB の余裕を残します。
    スクラッチツリーのセットアップ時 commit は、この系統では以前から入っています。
    そのためメタデータはレース開始前にフラッシュされます。

タイミング学習(セーブ内 XCFG 記録)、フリーズ修正、improved-20261121 のリトライ信頼性の移植は、そのままです。
アテンプト数(10回、最大30回)、遅延テーブル、ウェーブ数は upstream から変更していません。

状態:ソースとペイロードのレベルで検証済みです。
今回の2点は実機未検証です。
使うにはオートローダーのセーブを1回入れ直してください。
入れ直すとタイミング学習の記録は初期化されます。
戻すときは improved-20261121 で入れ直してください。

improved-20261117b

Choose a tag to compare

@yyoossk yyoossk released this 24 Nov 15:31

The Load Game payload is byte-identical to improved-20261117 (timing learning + freeze fix).
Only the save installer changed.
It now creates the save:/saves and save:/saves/Single folders first when they are missing.
Without this, the install failed with "create : 0x202" on consoles whose save data has no saves/Single folder.
This is the same installer fix as improved-20261124b, applied to the 20261117 payload so the proven payload can be reinstalled on any console.

「ゲームをロード」で動くペイロードは improved-20261117 とバイト単位で同一です (タイミング学習+フリーズ修正)。
変わったのはセーブのインストーラーだけです。
セーブデータにフォルダが無い場合、save:/saves と save:/saves/Single を先に作るようになりました。
これが無いと、saves/Single フォルダが無い本体ではインストールが「create : 0x202」で失敗しました。
improved-20261124b と同じインストーラー修正を 20261117 のペイロードに適用したものです。
実績のあるペイロードを、どの本体にも入れ直せるようにするための版です。

Retry reliability port — improved persist build (2026-11-21)

Choose a tag to compare

@yyoossk yyoossk released this 21 Nov 03:04

Retry reliability port — improved persist build

A fork of SeanHeuc/CivSwitchFS at commit 0f7b361 (the pin used by SeanHeuc/civ-autoloader), with the timing learning and freeze fix from improved-20261117, plus three retry-reliability changes ported from the design of s8n/CivSwitchFS-kaiHEN (slop branch).

What's new in this build

  1. Retirement precheck (src/core/helpers/cache.mjs, src/core/steps/cleanup.mjs)
    Before running the cache-retirement waves, the payload now reads back the candidate cache entry and classifies it (original / aliased / unexpected / unavailable). If the alias is already gone — a rejected timing window can still have cleared the valid byte — the retirement waves are skipped entirely and the state counts as verified. Fewer runs end in a false "Cleanup failed; another attempt is unsafe." stop, so more failures become safe same-boot retries.

  2. Cleanup cache invalidate (src/core/ipc/filesystem.js, src/core/steps/cleanup.mjs, src/core.js)
    Cleanup now invalidates the cached dirty scratch file (save:/hole/big8, 8 MiB) via IFile::OperateRange before deleting the scratch tree and committing, so the delete + commit starts from a clean cache state.

  3. Retune threshold (src/core/steps/campaign.mjs)
    The canary campaign now retunes its delays unless at least 80% of windows qualify (previously 50%), so in-run timing adjustments engage more readily across the up-to-30-attempt budget.

Unchanged: timing learning (the XCFG record in the save) and the bounded-IPC freeze fix work exactly as in improved-20261117. The attempt budget (10, up to 30), the delay tables, and the control-wave budget are unchanged from upstream.

Status: built from source and verified at the source and payload level. The three new changes have NOT yet been verified on real hardware (the 2026-11-17 improvements remain hardware-verified). To use this build, reinstall the autoloader save once; reinstalling resets the timing record. Reinstall with improved-20261117 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
  • This build: src/core/helpers/cache.mjs, src/core/steps/cleanup.mjs, src/core/steps/campaign.mjs, src/core/ipc/filesystem.js, src/core.js

Build

  • persist-bootstrap.js sha256 246786a36e0d42258f485bdfe28cf85dad448aeb24a8cbc10fe75ef94dbb3d77
  • save-template.bin sha256 32fa8a0d6dd0a480d8e541e63ea44c4619bc6f7be4282cfc3cb6a4f6d305dfae (unchanged from upstream)

Credits
Original work: SeanHeuc (CivSwitchFS / civ-autoloader), Gezine (CivSwitch). Retry design reference: s8n (CivSwitchFS-kaiHEN). Same license as upstream.


リトライ信頼性の移植 — 改良版 persist ビルド

SeanHeuc/CivSwitchFS(civ-autoloader が使うピン 0f7b361)のフォークです。improved-20261117 のタイミング学習とフリーズ修正に加えて、s8n/CivSwitchFS-kaiHEN(slop ブランチ)の設計からリトライの信頼性に関わる3点を移植しました。

今回の変更

  1. リタイア前チェック(src/core/helpers/cache.mjs、src/core/steps/cleanup.mjs)
    キャッシュのリタイア用ウェーブを走らせる前に、候補エントリを読み戻して状態を判定します(original / aliased / unexpected / unavailable)。エイリアスが既に消えていればウェーブ自体を省略し、安全とみなします。「Cleanup failed; another attempt is unsafe.」で止まってしまうケースが減り、同一ブート内で安全に再試行できる幅が広がります。

  2. クリーンアップ時のキャッシュ無効化(src/core/ipc/filesystem.js、src/core/steps/cleanup.mjs、src/core.js)
    スクラッチを削除してコミットする前に、汚れたスクラッチファイル(save:/hole/big8、8MiB)のキャッシュを IFile::OperateRange で無効化します。

  3. 再調整のしきい値(src/core/steps/campaign.mjs)
    タイミング再調整が働く条件を「合格率50%未満」から「80%未満」に変更し、最大30回のアテンプトの中で調整が効きやすくしました。

タイミング学習(セーブ内 XCFG 記録)とフリーズ修正は improved-20261117 のままです。アテンプト数(10回、最大30回)、遅延テーブル、コントロールウェーブ数は upstream から変更していません。

状態:ソースとペイロードのレベルで検証済みですが、今回の3点は実機未検証です(2026-11-17 の改良点は実機確認済み)。使うにはオートローダーのセーブを1回入れ直してください。入れ直すとタイミング学習の記録は初期化されます。戻すときは improved-20261117 で入れ直してください。

Timing learning + freeze fix — improved persist build (2026-11-17)

Choose a tag to compare

@yyoossk yyoossk released this 16 Nov 19:13

Timing learning + freeze fix — improved persist build
A fork of SeanHeuc/CivSwitchFS at commit 59a1ea6 (the pin used by SeanHeuc/civ-autoloader), with two improvements. Only 5 source files differ from upstream (407 insertions, 1 deletion). Confirmed working on real hardware (Switch 2, firmware 23.0.1, Civilization VII v1.0.0 cartridge).
What's new

  1. Timing learning (persistent winning schedule)
    Upstream, the FS canary campaign keeps its timing adjustments only in memory: every Load Game starts again from the stock delay table. This fork records the winning schedule in the save itself and starts from it on the next boot.
    A fixed-size record segment ( XCFG:1: + 120 hex chars: roleDelays ×10, guardDelays ×2, win counter, CRC32) is appended to the trigger record inside XSTRIG.Civ7Save at install time (zeroed = no record).
    On boot, the record is read through the game's own save mount before the race (src/core/timing-slot.mjs). If it validates (magic, CRC, win count ≥ 1, delays within ±1 ms of the stock table, strictly increasing), the run starts from it and the screen shows TIMING: recorded schedule loaded (win N); starting from it.
    After FS acquisition succeeds, the winning schedule is written back in place (same size, read-back verified): AUTOLOADER: TIMING: winning schedule recorded for the next boot.
    Safety: an invalid or corrupted record is ignored (stock behavior). Reinstalling the autoloader save resets the record to zero; installing with the upstream build removes the segment entirely. Fully reversible.
  2. Freeze fix (bounded IPC sends)
    Every IPC send in the payload was a bare svcSendSyncRequest, which has no timeout. When the FS service stops replying mid-race (a known failure mode of this exploit), the payload's only JS thread blocks forever and the console freezes on the last status line (observed at Checking the canary window...).
    sendIPC now runs each send on a sacrificial raw thread and waits at most 10 seconds (src/core/ipc/transport.js).
    On timeout, the packet is poisoned so reply parsing reports an error, a latch makes all later sends fail fast (so cleanup cannot hang either), and the run ends with File-system service stopped responding; the run was stopped safely. instead of freezing.
    If the raw-thread machinery is unavailable, it falls back to the original direct send.
    Note: this cannot make a wedged FS reply succeed — it turns an infinite freeze into a clean, visible failure you can retry from.
    Verified on real hardware (2026-11-17)
    The homemade loader setup (kaiHEN Installer) booted successfully with the Japanese version of the game on a Japanese console — not just overseas versions.
    Timing learning works as intended: after the first success recorded its schedule (win 1), the autoloader starts from the recorded timing on every later boot, and kaiHEN booted at a high rate from the second boot onward.
    The freeze at Checking the canary window... no longer occurs with the bounded-IPC build; the same boot sequence that previously froze now completes.
    Changed files
    src/core/timing-slot.mjs (new, +290)
    src/core.js (+22)
    src/core/autoloader.mjs (+13)
    persist/save-codec.js (+8)
    src/core/ipc/transport.js (+75/−1)
    Use
    Build as usual (npm ci && npm run persist:build), or use the attached prebuilt persist files with the civ-autoloader persist install flow. The attached build is byte-identical to the one verified on hardware:
    persist-bootstrap.js sha256 8179c983aa2853ca4f56fa3f4bd9315eb1f304e85ec5fd6562145b9332082b9b
    save-template.bin sha256 32fa8a0d6dd0a480d8e541e63ea44c4619bc6f7be4282cfc3cb6a4f6d305dfae (unchanged from upstream)
    The timing record only exists in saves installed with this build — reinstall the autoloader save once after switching.
    Credits
    Original work: SeanHeuc (CivSwitchFS / civ-autoloader), Gezine (CivSwitch). This fork only adds the two improvements above. Same license as upstream.

タイミング学習 + フリーズ修正 (改良版 persist ビルド)
SeanHeuc/CivSwitchFS (civ-autoloader が使うピン 59a1ea6) のフォークです。 upstream との差分はソース5ファイルのみ (407行追加・1行削除)。実機確認済み (Switch 2 / FW 23.0.1 / シヴィライゼーション7 カード v1.0.0)。
改良点

  1. タイミング学習
    成功したときの canary タイミングをセーブ内に記録し、次回起動時にそこから開始します。記録は検証付き (CRC・範囲チェック) で、不正なら無視されます。セーブを入れ直せば記録はリセットされ、upstream 版で入れ直せば記録欄ごと消える可逆な実装です。画面表示: TIMING: recorded schedule loaded (win N); starting from it.
  2. フリーズ修正
    タイムアウトのない IPC 送信が FS 無応答時に永久ブロックし、画面が凍結する問題を修正。送信を使い捨てスレッドで実行し最大10秒で打ち切ることで、固まる代わりに File-system service stopped responding; the run was stopped safely. と表示して安全に終了します。
    実機結果 (2026-11-17)
    自作ローダー (kaiHEN Installer) が、日本版のソフト・国内版本体でも起動しました (海外版だけではありません)。
    タイミング学習の効果: 初回の成功でタイミングが記録されて以降 (win 1)、オートローダーは毎回記録したタイミングから開始し、2回目以降は高い確率で kaiHEN が起動しました。
    「Checking the canary window...」で固まる問題は、修正版では発生しなくなり、以前固まった起動手順でも最後まで完了しました。
    使い方
    通常通り npm ci && npm run persist:build でビルドするか、添付のビルド済み persist ファイルをそのまま使えます。学習の記録欄はこの版でセーブを入れ直したときから作られます。