Repository navigation
fix(genome): one ledger row, one write — the jobs ledger no longer zips concurrent rows together - #4334
Conversation
|
Read the whole diff at You proved it red first, which was the ask. The comment records the failing evidence rather than claiming it: writer reverted to The pad carries its own justification. One thing worth naming because it isn't obvious from reading it: assert_eq!(lines.len(), 2_000, "run {run}: every row landed, none merged");That single assertion catches both production corruption modes, not just the one in the test's name. Interleaving merges two rows into one line (count drops below 2,000); tearing splits one row across a newline boundary (count rises above 2,000). The per-line On the fix itself: No word yet, and only on CI. Worth recording what this closes: 136 of 701 rows on the M5, two months of silent rot, and — once #4332's quarantine lands beside it — 320 terminal receipts and 245 registered rows that are unreadable today become reachable. One stops the rot, the other reads what's already rotted. Neither is sufficient alone. |
…ps concurrent rows together
Card faed9279 (Fable: 136 of 701 lines on the M5 unreadable, two shapes — byte-interleaved and torn — and the torn ones are preceded by corrupt ones, so both are the same interleave, not crashes).
job_board.rs journal() wrote `writeln!(f, "{line}")` on a raw File: `Value`'s Display emits the JSON as many write_str fragments, each its own write(2). O_APPEND lands each SYSCALL atomically at the end, not each LINE, so two tasks journaling at once zipped their records fragment by fragment. Every later reader of the ledger (dispatch recovery, #4332 history) then failed on those rows forever.
ledger_line(&Value) builds the compact JSON plus newline as one String; journal() issues a single write_all. Test two_writers_never_zip_their_rows_together: 2 threads × 1,000 rows × 200-char pad × 5 runs → 2,000 rows, every one parses and carries its own writer id. Proven red first: with the writer reverted to writeln!, run 0 line 0 was already unreadable ("expected `:` at line 1 column 9"); green with the fix.
Not this commit: quarantining rows already corrupt on disk (#4332), and the per-tick RecoveryRequired announcement (00208bde).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
c6f7f2d to
4a4b09c
Compare
|
Verified the rebase at
That matters here more than on a typical rebase, because these two changes are complementary by design and No word yet — For the record, what this pair does once both are in: #4332 makes the existing 320 terminal receipts and 245 registered rows readable through the quarantine; this stops the ledger corrupting further. Neither is sufficient alone, and — worth being plain about it — neither settles a training credit. Staged credits on this node went 1 → 3 → 6 → 7 tonight with settled at 0 throughout. These fix the ledger, not the flywheel. |
|
APPROVE at exact head All 6 green, verified directly: This is the fix for the defect on card
The Yours to merge. One thing that should not be read into this approval: this stops the ledger corrupting; it does not settle a training credit. Staged credits on this node went 1 → 3 → 6 → 7 tonight with settled at 0 throughout, and |
fix(genome): one ledger row, one write — the jobs ledger no longer zips concurrent rows together
Card faed9279 (Fable: 136 of 701 lines on the M5 unreadable, two shapes — byte-interleaved and torn — and the torn ones are preceded by corrupt ones, so both are the same interleave, not crashes).
job_board.rs journal() wrote
writeln!(f, "{line}")on a raw File:Value's Display emits the JSON as many write_str fragments, each its own write(2). O_APPEND lands each SYSCALL atomically at the end, not each LINE, so two tasks journaling at once zipped their records fragment by fragment. Every later reader of the ledger (dispatch recovery, #4332 history) then failed on those rows forever.ledger_line(&Value) builds the compact JSON plus newline as one String; journal() issues a single write_all. Test two_writers_never_zip_their_rows_together: 2 threads × 1,000 rows × 200-char pad × 5 runs → 2,000 rows, every one parses and carries its own writer id. Proven red first: with the writer reverted to writeln!, run 0 line 0 was already unreadable ("expected
:at line 1 column 9"); green with the fix.Not this commit: quarantining rows already corrupt on disk (#4332), and the per-tick RecoveryRequired announcement (00208bde).
Receipt at 4a4b09c (rebased onto canary ea54c96, on top of #4332's rewrite of job_board.rs; same one-commit content):
cargo test … -- genome::fine_tuning::job_board::tests→ 5 passed / 0 failed. Mutation: writer reverted towriteln!→two_writers_never_zip_their_rows_togetherred at run 0 line 0 ("expected:at line 1 column 9"); restored → green.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE