docs: fix 7 wrong comments from the commenting pass (stale facts from the freemap rewrite + extraction) - #84
Merged
Conversation
Stale facts left by the multi-page-freemap rewrite + the transaction.rs extraction (the code was correct; the prose drifted): - page_io.rs PageIo::fsync + the Memory-backing note: 'twice per commit' -> three fsyncs (I28 pre-drain + data + superblock). - page_cache.rs flush Phase-1b: 'two-fsync commit cost' -> three-fsync. - defrag.rs algorithm-doc steps 3 & 6: 'net drop in data-page count' -> set difference of page-ID snapshots (the file header already said so). - freemap_tree.rs is_free: 'only #[cfg(test)] consumers' was false — reclaim_orphans is a production caller; corrected, and dropped the now- incorrect #[allow(dead_code)] (clippy confirms it is genuinely used). - freemap.rs header: 'current_freemap' -> the COW freemap tree (the flat bitmap that name referred to no longer exists; I18 ordering unchanged). - page_cache.rs new_page: freed pages are reclaimed by the freemap reuse path (cow_alloc -> claim_page), not only by defrag; and the rollback path is discard_all_dirty + truncate (I3), not the dead discard(). - python/errors.rs: 'matches is_fatal() exactly' -> note PoisonedError is a deliberate FatalError subclass even though is_fatal() excludes Poisoned. Comments only (plus the one dead-code attribute removal). 578 Rust / 119 pytest green, clippy + fmt clean. The page_cache.rs:515 'second of three fsyncs' comment flagged by an agent was a false positive — already correct.
🚦 Bench results: PR vs main
Per-scenario detail (4 metrics × cells)document-store
mutation-log
ycsb-a
ycsb-b
|
Xof
added a commit
that referenced
this pull request
Jul 1, 2026
Resolve the sole conflict in src/page_io.rs: main's commenting pass (#83/#84) corrected the fsync doc-comment from "twice" to "three times per commit" (I28 pre-drain flush + data pages + superblock), while this branch renamed the Memory backing field pages -> bytes. Kept both: the corrected "three times" comment (still accurate under encryption — the per-page seal changes the unit size, not the fsync count) and a match pattern valid for the renamed field (`Backing::Memory { .. }`). The other three shared files (python/src/errors.rs, src/defrag.rs, src/page_cache.rs) auto-merged cleanly. Verified on the merged tree: 680 tests across 32 suites pass, clippy clean on lib + chisel-py.
Xof
added a commit
that referenced
this pull request
Jul 1, 2026
…#87) An adversarial commenting pass over the on-disk encryption code (merged in #85). Comments only — no behavior change; full test suite, clippy, and fmt stay green. Wrong facts: - crypto/mod.rs: derive_kek's `# Errors` said BadKeyLength fires only for `kdf == Hkdf` with empty raw bytes; the empty-key check is unconditional (before the KDF match) and covers Raw and Passphrase. - superblock/mod.rs (x2): sealed-superblock comments said sensitive scalars 16..52 are zeroed, but page_size is cleartext at 48..52 — the zeroed range is 16..48. - python/src/db.rs: key coercion claimed an empty/bad raw key raises BadKeyLength via to_py_err; every CryptoError maps to InvalidEncryptionKey -> InvalidEncryptionKeyError (there is no BadKeyLength Python error). - transaction/recovery.rs: "Slot 0 was written last" — it is written first (i=0, highest counter superblock_count-1). - transaction/keys.rs (test): comment said txn_counter=3 after fresh_encrypted; it is 2. Stale: - page_io.rs: header still said "Two fsyncs per commit"; it is three (I28 pre-drain + data + superblock) — the header #84 missed. - transaction/commit.rs + lifecycle.rs: CommitCtx described as "ten pieces" of state; the cipher + crypto_header fields make it twelve. - python/src/errors.rs: exception-hierarchy comment omitted DecryptionFailedError from the FatalError tier. Three further candidates could not be adversarially verified (transient rate limit) and were left as-is rather than rewritten on an unverified claim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #83 (the commenting pass), fixing the 7 actively-wrong comments it surfaced. These are almost all comment-rot from the multi-page-freemap rewrite and the transaction.rs extraction — the code is correct, the prose drifted to describe the old single-page-freemap / two-fsync world.
page_io.rsPageIo::fsync(×2)page_cache.rsflush Phase-1bdefrag.rssteps 3 & 6freemap_tree.rsis_free#[cfg(test)]consumers" was false —reclaim_orphansis a production caller; also dropped the now-incorrect#[allow(dead_code)]freemap.rsheadercurrent_freemap→ the COW freemap tree (that flat-bitmap name no longer exists)page_cache.rsnew_page(×2)discard_all_dirty+truncate, not the deaddiscard()python/errors.rs(×2)is_fatal()exactly" → notePoisonedErroris a deliberateFatalErrorsubclass even thoughis_fatal()excludesPoisonedVerified: 578 Rust / 119 pytest green; clippy
--all-targetsclean (confirms theis_free#[allow(dead_code)]removal is safe — it's genuinely used); fmt clean.One agent-flagged item (
page_cache.rs:515"second of three fsyncs") was a false positive — already correct — so it was left untouched.