STEP 1741 — ransbench 交絡分離 + counter fix

STEP 1731 の 3 点フィードバック応答: (1) "greedy vs optimal" 表記統一 + bound 方向明記 · (2) 4-corpus 2x2 で文字集合 × 構造 交絡分離 · (3) claim-step.ts に auto-sync 内蔵
2026-09-04 · rei-aios-8a tab · worktree step1724-ransbench_arc

Executive summary
  1. Task 1: "optimal K=8" → "greedy K=8" に統一 + 96.6%/89.1% は下界 (greedy ≤ true opt) / D-FUMT₈ 87%/26% は上限値 と明記。
  2. Task 2 (v3 corrigendum で最終形): 4-corpus 2x2 + Gutenberg 追試 + within-corpus paired charset contrast で 3 段の深化: (v1) charset major (docstring only) → (v2) corpus 反転 (Melville で structure 勝) → (v3) pure charset は 4 種 contrast 中最小 (D8/gr 5.3 pts / ARI 0.134)、v1/v2 の "charset 25-38 pts" は実は charset + 書記体系 + 言語 + Japanese byte structure の合成量、20 pts 分が confound。順位主張は corpus × metric の 4 通り中 1 通りでしか成立しない。
  3. Task 3: scripts/claim-step.tscmdClaim--sync-from-git internal 内蔵。実測 drift +9 auto-heal 動作確認 (counter 1732 → git_highest+1=1741 → advance)。

1. Task 1 — 表記統一 + bound 方向

STEP 1731 の全出力で「最適 K=8」「greedy optimal K=8」→「greedy K=8」「貪欲 K=8」に統一。

Bound の向き (正確な数学的表現)

greedy_I(K)   ≤   true_optimum_I(K)   ≤   full_256_I

  greedy_I / full_256_I    (96.6% Python / 89.1% Prose)
   = LOWER bound on true_optimum_I / full_256_I
     → 真の最適の効率はこれ以上

  D-FUMT₈_I / greedy_I     (87% Python / 26% Prose)
   = UPPER bound on D-FUMT₈_I / true_optimum_I
     → 真の相対達成率はこれ以下

正しい主張: 「D-FUMT₈ は Python で最適の 87% まで捕捉、Prose で 26% まで」= 上限値、真の効率はこれ以下。

2. Task 2 — 交絡の解消 (4 corpus 2x2)

STEP 1731 の Python (ASCII + code) vs Prose (UTF-8 + 自然言語) 比較は 2 変数を同時に動かしており、「非 ASCII 混じり自然言語」1 変数への特定不可。追加 2 corpus で 2x2 実験。

Corpus 構成

corpussizenon-ASCII %種別建て方
python_1mib1 MiB0.0%構造化 codePython 3.13 stdlib .py concat
english_ascii_1mib (新)1 MiB0.0%自然言語 prosestdlib docstring/comment 行 (ASCII 純, prose-heuristic filter)
json_utf8_1mib (新)1 MiB19.7%構造化 datamemory md metadata の JSON dump (JP 文字列 値)
prose_1mib1 MiB34.3%自然言語 prosememory md concat (JP + EN 自然文)

実測 2x2 (D-FUMT₈ lex_class / greedy K=8 = 相対達成率 UPPER bound)

D-FUMT₈ / greedy
ASCII (0% non-ASCII)
UTF-8-heavy (20-34%)
structured
87%python_1mib · ARI 0.57
65%json_utf8_1mib · ARI 0.11
prose
80%english_ascii_1mib · ARI 0.55
26%prose_1mib · ARI 0.06

差分分解

EffectFixVaryΔ (pts)
文字集合structuredASCII → UTF-887 → 65 = −22
文字集合proseASCII → UTF-880 → 26 = −54
構造ASCIIcode → prose87 → 80 = −7
構造UTF-8data → prose65 → 26 = −39

周辺効果 (marginal): 文字集合 = 平均 −38 pts / 構造 = 平均 −23 pts。文字集合の効果が構造の約 1.65 倍。

交互作用 (interaction): additive model なら (Python 87% − 22 − 7) = 58% を予想。実測 Prose 26% は予想を −32 pts 下回る = UTF-8 と prose が同時にあると相乗的悪化

5 corpus 実測 (Gutenberg 追試込み)

corpuskindD-FUMT₈ Igreedy K=8 Ifull 256 ID8/greedyARI
python_1mibASCII code0.03480.04000.041487.0%0.571
english_ascii_1mibASCII prose (docstring)0.01890.02350.026880.4%0.555
gutenberg_moby_1mib (追試)ASCII prose (Melville 純文学)0.00920.01660.021055.4%0.339
json_utf8_1mibUTF-8 data0.02040.03150.033864.8%0.111
prose_1mibUTF-8 prose (JP+EN)0.00490.01870.021026.2%0.056

Robustness (Gutenberg Moby Dick 追試) — decisive finding

docstring corpus は純自然英語 prose の robustness verify として不十分:

v3 corrigendum — 揃った 2 軸周辺平均 (marginal mean)

v2 での structure 分解が ASCII 軸 conditional のみ (−31 / −7) だったため v1 の 2 軸周辺平均 (−38 / −23) と計算方法が不揃い。両者を同じ 2 軸平均で揃えると:

anchor (D8/gr metric)charset avgstructure avg優越
docstring anchor−38.2−22.6charset (1.7×)
Melville anchor−25.7−35.1STRUCTURE (1.4×)

Structure の Melville-anchor 値は −26〜−31 pts ではなく −35.1 pts (UTF-8 軸 −38.6 込み)。anchor で優越関係が反転 — v2 の「両者拮抗」は不正確、正しくは「anchor 反転」。

Metric dependence — ARI では反転しない

anchor (ARI metric)charset avgstructure avg優越
docstring anchor0.4800.036charset (13.5×)
Melville anchor0.3710.144charset (2.6×)

ARI では両 anchor で charset 優越。順位反転は D8/greedy 比の列にのみ現れる。json (D8/gr 65% / ARI 0.111) と Melville (D8/gr 55% / ARI 0.339) が % と ARI で 逆順 = 2 metric は互いに単調でない → Pattern J は "corpus 依存" だけでなく "corpus × metric 依存" に拡張。順位主張は 4 通り中 1 通り (Melville anchor × D8/gr) でしか成立しない。

③ Within-corpus paired charset contrast — 交絡 1 本潰し

クロス corpus の "charset" 軸は charset ⊗ 書記体系 ⊗ 言語 の 合成量 (JP は 3 バイト列 + 空白なし + 文字種数桁違い)。同一 gutenberg_mobyUTF-8 と ASCII-strip の paired contrast = charset だけを varying (1.74% non-ASCII の混入率のみ差)。

corpusnon-ASCIID-FUMT₈ Igreedy K=8 Ifull 256 ID8/greedyARI
moby_paired_utf81.74%0.00880.01760.022450.3%0.205
moby_paired_ascii0.00%0.00920.01660.021055.6%0.339
Δ (UTF-8 → ASCII)−1.74pt+0.0004−0.0010−0.0014+5.3+0.134

同一 1,036,451 chars of Moby Dick、encoding だけ変える (Gutenberg -0.txt UTF-8 で curly quote/em-dash 系 1.74% を含む/含まない)。「わずかな非 ASCII でも効く」の下限測定。

Paired-clean effect decomposition (v3 最終)

effect説明D8/gr ΔARI Δ
pure charsetMoby Dick 同一 chars、UTF-8 vs ASCII (paired)+5.3+0.134
prose type (English 内)docstring (技術) vs Melville (文学)、両 ASCII+25.0+0.216
code vs prose (ASCII 内)Python vs Melville ASCII、両 ASCII 英語+31.6+0.232
cross-corpus lang+scriptMelville ASCII vs prose JP+EN+29.2+0.283

Pure charset は 4 種 contrast 中最小 (D8/gr 5.3 pts / ARI 0.134)。v1/v2 で「charset」と呼んでいた 25-38 pts の大半は charset + 書記体系 + 言語 + Japanese-specific byte structure の合成量 = 25.7 - 5.3 = 20.4 pts が confound (writing system + language + Japanese byte-per-char 分布)。

v3 final finding — 順位主張は corpus × metric の 4 通り中 1 通りでしか成立せず:
  1. Pure charset effect は 4 種 contrast 中最小 (D8/gr 5.3 pts / ARI 0.134)。v1/v2 で「charset」と呼んでいた 25-38 pts の大半は charset + 書記体系 + 言語 + Japanese-specific byte structure の合成量だった。paired within-corpus で isolate すると 20 pts 分が confound と判明。
  2. Anchor 反転は D8/gr metric のみ: (a) docstring anchor で charset 勝、(b) Melville anchor で structure 勝、(c) 両 anchor × ARI で charset 勝。corpus × metric の 4 通りのうち 1 通りでしか「structure > charset」順位が成立せず。
  3. 安全に主張できる範囲: 「charset・structure・prose type・lang+script いずれの因子も実在するが、pure charset が最小 (~5 pts) で、prose-type-within-English (~25 pts) や code-vs-prose (~32 pts) の方が大きい」。「主因」の順位付けは corpus × metric に依存し robust でない。
  4. 元の「非 ASCII 混じり自然言語で失われる」は実は「Japanese 特有の byte distribution + prose type + language」で失われる、pure charset (UTF-8 化そのもの) は小効果。「わずかな非 ASCII でも 5 pts 効く」は下限測定として保持、ただし cross-corpus の 25-38 pts とは別 order of magnitude。
  5. この STEP は「主張を弱めた」記録ではなく「順位主張が corpus × metric の両方に依存することを定量的に示した」記録。前 STEP 1741 v1/v2 の「charset major」claim は出版すべきでない結論だった (指摘通り STEP 1741 で止めた判断は正しかった、v2 でも不十分)、v3 で pure charset isolate + metric dependence 発見で議論の土台が固まった。

3. Task 3 — counter auto-sync 内蔵

scripts/claim-step.tscmdClaimcomputeGitHighestStep() を internal 呼出、drift 検出時 auto-heal + warning。実測動作:

$ npx tsx scripts/claim-step.ts --slug test_counter_fix_smoke
[claim-step] counter drift auto-healed: state.next=1732 < git_highest+1=1741 (drift=+9). Advancing before claim.
STEP 1741

Cost/benefit: 各 claim で git log --oneline --all = ~200-500ms overhead。対して STEP 1724→1731 renumber cleanup では 11 file × 27 参照の手動 rename が必要だった。頻繁な小コスト vs 稀な大コストで前者を選択。

Opt-out: 環境変数 CLAIM_STEP_NO_SYNC=1 で無効化 (test harness / minimal CI 用)。git log 失敗時は非致命的に fallback (counter 単独信頼)。

Peek も同 sync: --peek が drift を検出したら sync-safe next を表示 (state は書き換えない)。

4. 統合 conclusion (v3)

  1. STEP 1731 の観測「D-FUMT₈ は Prose で崩壊」の原因は「非 ASCII 混じり自然言語」ではあるが、pure charset (UTF-8 化そのもの) は最小効果 (~5 pts)。実際の主因は Japanese-specific byte structure + prose type + language の複合
  2. D-FUMT₈ lex_class 8 クラスの内、class 6 (非 ASCII) 単純化の設計判断だけでは 5 pts しか説明せず、残り 20-30 pts は class 0-5 の粒度不足 (English literary prose では docstring の 5 倍程度 D-FUMT₈ の失敗率が高い、pure charset とは独立の効果)。
  3. 論文化する場合の安全な主張形式: 「D-FUMT₈ 8 分割は情報論的に (a) ASCII code で 87% 以下、(b) ASCII prose で 55-80% 以下 (prose type 依存, docstring:80 / Melville:55)、(c) UTF-8 では pure charset 効果 5 pts に加え、書記体系 + 言語の複合が追加影響。原因の相対 ranking は corpus × metric に依存し robust でない。paired within-corpus 実験のみが charset を isolate 可能」
  4. D-FUMT₈ 改良の direction: 非 ASCII を 1 class にまとめる代わりに 8 分割で細分する場合、pure charset 5 pts のみ回復。より大きな gain (25-32 pts) が prose type / code-vs-prose separation にある = literary text 特有の byte distribution を意識した class 設計余地。

5. Honest scope

6. Artifacts