Skip to content

Red control for #530: row targets ignore the values offset (do not merge) - #531

Draft
jonathan308 wants to merge 4 commits into
mainfrom
test/checkpoint-concurrent-row-decode-red
Draft

jonathan308 wants to merge 4 commits into
mainfrom
test/checkpoint-concurrent-row-decode-red

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 24, 2026 •

Copy link
Copy Markdown

Proposed changes

Red control for #530 (do not merge). This branch is #530's code plus one commit with a deliberate defect (head
aaae679953: the mutation 4c4527200b on #530's 9db9dfc15c, then #530's test fix f335812335 cherry-picked, so its
tree is #530's head f335812335 plus the mutation; the first CI run did not build the test target, as on #530): CBv2PagedCheckpointStorage.rowTargets drops the values offset, so value rows decoded straight into their
pages land on key rows.

A tests-only control is not possible for #530: its new tests call the new API (rowTargets, the decoder's thread and
wave parameters), so without the change they do not compile.

Expected CI: Fork Tests fails at the tests that write paged rows through rowTargets:

  • the new tests CBv2PagedCheckpointRowTargetsTests.sameBytes (FP16, BF16, FP32) and
    NativeQuantizedPagedCheckpointTests.concurrentRestoreIsBitIdentical (FP16, BF16, FP32);
  • and, because perf(checkpoint): decode a restore's coded rows on several cores, into its pages #530 routes the default lossy paged restore through rowTargets, the existing lossy paged restore
    tests NativeQuantizedPagedCheckpointTests "Interior native cuts keep ring mapping, exact recent rows and native
    serving pages" and NemotronSuperLossyCompleteCheckpointTests.assistantHistoryRestoresExactlyBesideLossyTargetRows.

Observed in Fork Tests run 45341070065, attempt 2: exactly these four tests fail, every other test runs and passes.
Attempt 1 also had a 30 s engine-step watchdog in a cold (unrestored) donor of Inkling2PrefixRealGeometryTests and
one shard that could not download the test products; both passed when the failed jobs ran again.

Checklist

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

AI usage

  • I have read this PR description in full and approve it as my own, and it
    accurately describes the code changes.
  • AI usage disclosure: Drafted with AI assistance (Claude) under the author's direction.

jonathan308 and others added 3 commits November 23, 2026 22:08
…o its pages

A complete-checkpoint restore of a lossy (balanced) checkpoint decoded every
coded row on the staging thread, then copied it 16 KiB at a time into the
staged pages, and the pages themselves were staged as copied host zeros.
Models that store their sliding-window layers coded paid this cost on every
restore, even for a one-block hit.

- With more than one decoding thread (at most eight, and at most half the
  active cores), the streaming row decoder decodes the whole rows of a
  transfer call concurrently, a wave of 1,024 rows at a time. Rows of a paged
  native layer are written straight to their page addresses
  (CBv2PagedCheckpointStorage.rowTargets, the same addresses append writes);
  other rows keep the ordered batched sink calls. Each row's bytes are a pure
  function of its coded bytes, so the restored state is unchanged. A refused
  row fails the transfer with the same error, and the staged rows are those
  the sequential decode leaves.
- Provider-staged checkpoint segments wrap zero-fill-on-demand pages when the
  live pool does (PagedKVPoolConfig.hostZeroedSegments), as admission growth
  already does, instead of copying host zeros into fresh buffers.
- The wave's scratch and bookkeeping are charged with the import's decoder
  scratch.
- DARKBLOOM_PREFIX_CACHE_PARALLEL_STAGE=0 keeps every row on the calling
  thread and the original sink path; a pool without hostZeroedSegments keeps
  copied host zeros.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…row decode

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deliberate defect so the row-target and restore tests show they detect a
wrong destination: CBv2PagedCheckpointStorage.rowTargets drops the values
offset, so value rows land on key rows. Not for merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
writeNative now writes into a caller's buffer (writeNative(_:into:)), so
the existing testBF16CheckBeforeRoundingRefusesNaNsThatRoundToFiniteWords
gives it one row of BF16 destination. The assertion is unchanged: every
NaN pattern that rounds to a finite word is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonathan308 jonathan308 mentioned this pull request Nov 24, 2026
2 of 3 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant