# === v8-cjk-full-2k — the 2,000-step probe that runs before v8-cjk-full.yaml. ===========================
#
# Same role as v8-jp-full-2k for v8-jp-full, with the same deliberate deviations (warmup 200, cosine fully
# annealed inside 2,000 steps, eval every 250, val_rows 4096, two saves) so the two probes are read against
# each other and neither against a 24k from-scratch run. It answers, before the 24k spend:
#
#   1. Does the 49-label `stage3-cjk` head load, train, save and reload on the char path? The launch log
#      must print the head param group as 49 × 384 + 49 = 18,865 params at 0.001.
#   2. Does the CN source yield? The first full-run launch died before step 1 because `country_weights`
#      rejected 98% of the 126 CN rows (see v8-cjk-full.yaml's header). The eval dump must contain a
#      `support_tag.locality_unit` > 0 and an `f1.locality_unit` column that moves off zero.
#   3. Does the mixture cost early JP learning? The comparison arm is v8-jp-full-2k's step-2000 checkpoint
#      re-scored on the same instrument (`score_jp_probe_board.py`, jp-board.jsonl, 20,000 rows) on
#      2026-09-05: blended coordinate-acceptability 0.9931, municipality span exact-match 0.9947, district
#      0.9870, block 0.9980. (The 24k record's original 0.2237 / 0.1847 was a scorer artifact. the record
#      records the correction.) Rule: no JP tag more than 1pp under that arm at step 2,000, the same width
#      the 24k from-scratch run applies against the 24k record. Read on 2026-09-05: blended 0.9840, municipality 0.9856,
#      district 0.9808, block 0.9954, house_number 0.9928 — every tag inside 1pp, municipality and district
#      the closest to it, and the 24k from-scratch run launched on that reading (app ap-J0uaLu8mQutAWu4ZdtBNzZ).
#   4. Does the scorer run end to end against a `stage3-cjk` checkpoint with `--label-set stage3-cjk`?
#
# Every setting not listed above is byte-identical to v8-cjk-full.yaml. If you change that file, change this one.
#
# Launch:
#   node packages/mailwoman/tools/training/launch/launch.run.ts sync --corpus v8cjk
#   node packages/mailwoman/tools/training/launch/launch.run.ts start --config v8-cjk-full-2k.yaml --fresh

data:
  corpus_dir: /data/corpus/versioned/v8-cjk-2026-09-05
  # Unused in char mode (SentencePiece is skipped entirely); kept pointing at the production
  # tokenizer so config auditing stays uniform. Same as v8-jp-full.
  tokenizer_dir: /data/models/tokenizer/v0.9.0-multisplice
  max_length: 96
  country_weights:
    JP: 1.0
    CN: 1.0
  # The mixture (see the header): per-pull source multinomial, exhausted sources restart.
  source_weights:
    overture-jp: 0.98
    coarse-placer-cn-units: 0.02
  coarse_filter: false
  # 4,096 as in v8-jp-full-2k: eight eval points read the shape. About 82 of them are CN pulls.
  val_rows: 4096
  # The 49-label CJK head. Supported only on the char path. the SP path raises (#1349's lesson).
  label_set: stage3-cjk
  char_mode: char
  char_vocab_path: /data/corpus/versioned/v8-cjk-2026-09-05/char-vocab-cjk.json
  char_ctx: 3
  max_unit_width: 7
  max_units: 96

model:
  # v8-jp-full's geometry, unchanged, so the two deltas above are the only deltas.
  hidden_size: 384
  num_hidden_layers: 4
  num_attention_heads: 6
  intermediate_size: 1536
  max_position_embeddings: 96
  use_crf: false
  label_smoothing: 0.1
  use_char_embed: true
  char_embed_dim: 64

train:
  output_dir: /data/output-v8-cjk-full-2k-s42
  seed: 42
  batch_size: 256
  eval_batch_size: 512
  learning_rate: 5.0e-4
  classifier_learning_rate: 1.0e-3
  warmup_steps: 200
  max_steps: 2000
  eval_every_steps: 250
  # Saves at step 1000 and 2000: the char-path save is what v8-jp-full-2k bought insurance against.
  save_every_steps: 1000
  log_every_steps: 50
  precision: bf16
  lr_schedule: cosine
  grad_clip_norm: 1.0
