GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — perf(id-events): memoize verified stored decodes by dezren39 · Pull Request #15654 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

  • Add a bounded, generation-aware memo of fully verified stored events keyed by a fresh digest of the exact bytes read. Repeated position, by-ID, and applied-event reads reuse the verified decode; misses still take the full decode path.
  • In check_invariants, keep the already verified dependency lists from the first scan and reuse them in the second scan of the same read transaction. This avoids decoding each applied event twice without retaining a second full Event clone.
  • Cap memo retention at 256 entries and 4 MiB of encoded rows; do not cache a single row larger than 64 KiB. Ingest and prune generation changes clear the memo.

Evidence

  • Failing first: Fleet run 45854148561 compiled the test-only oracle on the pre-implementation commit and failed because a stored read left the cache empty.
  • Focused and corruption coverage: Fleet run 45870734737, final head 82a9880, passed all 7 tests: four memo/invariant tests plus three existing corruption tests.
  • Matched performance: Fleet run 45872076039 ran each named test on the same runner, first at main parent 091f77e, then at 82a9880:
    • test_loopback_converges_for_mixed_k_and_t: 6.77s → 6.72s
    • test_clear_tag_chunks_600_claims_into_three_events: 20.38s → 20.37s
    • test_a_batch_decides_and_stores_what_per_event_ingest_does: 33.91s → 22.80s (33% faster)
    • test_an_interrupted_session_restarts_without_duplicates: 6.30s → 6.33s
    • Combined: 67.36s → 56.22s (16.5% less time).
  • rustfmt --edition 2024 --check on changed Rust files and git diff --check pass.

Merge Danger

Medium. Every cache miss recomputes the digest from the current row bytes and performs the full signature and canonical-form verification. The tests prove byte rewrites miss the memo and remain rejected as corrupt. The invariant-check reuse is scoped to one read transaction after the first full verified decode.

Closes #15328

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dezren39 added 5 commits November 26, 2026 09:56
@dezren39
test(id-events): cover stored decode memo oracle
66ba78e
@dezren39
perf(id-events): memoize verified stored decodes
0609c3f
@dezren39
perf(id-events): reuse verified decodes across read paths
e0e9bb2
@dezren39
Merge remote-tracking branch 'origin/main' into agent-next-19-local/1…
17da5bb
…5328-digest-memo-20261126T1555Z
@dezren39
fix(id-events): pass decode memo to compaction
3e224ca
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2d1f0523-b9dd-43ad-beaa-e36d25c7381d
Commits

Reviewing files that changed from the base of the PR and between c2b28df and 82a9880.

Files selected for processing: 3

  • pkgs/id/crates/id-events/src/event_store/anchors.rs
  • pkgs/id/crates/id-events/src/event_store/mod.rs
  • pkgs/id/crates/id-events/src/event_store/threads.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dezren39 added 3 commits November 26, 2026 11:03
@dezren39
perf(id-events): cache only repeated verified reads
ed03edc
@dezren39
test(id-events): cover invariant decode reuse
079b39b
@dezren39
perf(id-events): avoid invariant decode pass duplication
82a9880
This was referenced Nov 26, 2026
[Performance] pkgs/id unit tests take 358s against the 120s target — profile and cut #15142
Open
id-events: stored-event decode re-verifies and re-canonicalizes on every read (~7ms/decode at opt-0) #15328
Closed
@dezren39
dezren39 merged commit 6b675fa into main Nov 26, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the agent-next-19-local/15328-digest-memo-20261126T1555Z branch November 26, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

id-events: stored-event decode re-verifies and re-canonicalizes on every read (~7ms/decode at opt-0)

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.