8000 feat(storage): v8 hardening, measurements and docs (PR 5 of 5) by adityamukho · Pull Request #452 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

feat(storage): v8 hardening, measurements and docs (PR 5 of 5) - #452

Merged
adityamukho merged 7 commits into
v3from
feat/v8-pr5-hardening
Oct 6, 2026
Merged

adityamukho merged 7 commits into
v3from
feat/v8-pr5-hardening

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Summary

PR 5 of 5 of the v8 storage format: hardening, measurements and docs (spec §10–§12; plan section "PR 5"). The file format does not change. With this PR, every delivery PR in the spec is done.

Changes

  • Damaged pages are reported, not worked around. DatalogExecutor::selective_fact_fetch turned an indexed-lookup error into a fallback full scan (.ok()?), which could hide a damaged AEVT or EAVT page behind the other index. It now returns Result<Option<_>> and propagates. A derived-facts read in the executor uses ? instead of unwrap_or_default.
  • Faster reads. Committed reads seed their dictionary memo with the entity UUID and attribute name the caller passed. Each committed reader keeps a bounded cache (65,536 entries per map, cleared when full) of ident and transaction-timestamp lookups, shared across reads; neither changes after commit.
  • Benchmarks: checkpoint/after_1_fact/1m and a new checkpoint/after_100k_facts/{10k,100k}.
  • Nightly: the smoke workflow also runs the 1.15M-fact size test.

Measurements

10k 100k 1M
checkpoint/after_1_fact 3.0 ms 3.3 ms 6.1 ms
checkpoint/after_100k_facts 1.19 s 1.27 s —

Tests

  • Corruption (persistent_facts.rs): damage an EAVT leaf, an EAVT internal node, a DICT leaf, a value page, an AEVT leaf and a free-list page in turn.
    • Every read that reaches the page fails with STG-029; reads that don't reach it still work.
    • A checkpoint that pops from the damaged free-list page fails, and the file reopens at its last generation with every fact intact.
  • End to end (index_corruption_test.rs): queries through Minigraf on a file with damaged leaves fail with STG-029.
  • Size: size_per_fact_in_433_shape (144k facts, every run) and size_per_fact_in_433_shape_1m (ignored, nightly).
  • Shared cache: results are unchanged with a warm cache, and the cache stays bounded.
  • Full suite: 1,227 passing, 9 ignored. cargo clippy --all-features -- -D warnings is clean.

Docs

Refs #374 #434 #388 #433

🤖 Generated with Claude Code

https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn

adityamukho and others added 7 commits October 6, 2026 09:45
…full scan

selective_fact_fetch swallowed lookup errors and fell back to a full scan,
which could hide a damaged index page behind another index. It now returns
the error. Corruption tests damage an index leaf, an internal node, a DICT
leaf, a value page and a free-list page: every read or checkpoint that
reaches the page fails with STG-029, and the file still opens at its last
generation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
144k facts runs in every test run; 1.15M is ignored and runs in the nightly
smoke workflow. Both measure 142 bytes per fact, history included, against
the spec's limit of 200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
Committed reads seed their dictionary memo with the entity UUID and
attribute name the caller already passed, and each committed reader keeps a
bounded cache of ident and transaction-timestamp lookups shared across
reads; neither changes after commit. Concurrent point queries at 100k facts
are 19-31 % faster than after PR 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
@codecov
codecov Bot commented Oct 6, 2026
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/storage/dict.rs 96.96% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

8000

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

0