Skip to content

Hash the capability classes that produce bus projections - #2773

Merged
trissim merged 5 commits into
mainfrom
perf/projection-replay
Oct 23, 2026
Merged

trissim merged 5 commits into
mainfrom
perf/projection-replay

Conversation

@trissim

@trissim trissim commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

The bus projection digest from #2760 missed the classes that produce the rows. Editing Message.projections or Claimed.project_into left MessageIdentitySource.producer_digest() unchanged (5d6fc04d49a36cb0 before and after the edit), so an install kept stale projections as fresh.

  • ProducedRow.producer_capabilities declares each record family with the capability that produces its rows; BusProjectionTables.producer_classes derives from it.
  • _producer_digest hashes the producers' MRO classes under the family, the table, or that capability: Message, Claimed, Addressed, ClaimMessage and BusCapability join; infrastructure (field_codec, typed_table, declared_family) stays out.
  • ClaimOwner.__post_init__ no longer round-trips every field through FieldCodec; its only builder Acquisition.claimed passes a validated acquisition's fields.
  • test_projection_digest_tracks_producing_source gains the two edits that slipped through.

Rebuild timings and the projection row comparison are in the comments.

🤖 Generated with Claude Code

Ratchet test and others added 3 commits October 23, 2026 08:51
The projection digest from #2760 hashed only the record family and the
table classes, so editing Message.projections or Claimed.project_into left
every stored projection marked fresh. Each producer family now declares the
capability whose declarations produce its rows, and the digest covers that
capability's classes in the producers' MRO.

ClaimOwner no longer re-encodes its fields on construction: its only
builder, Acquisition.claimed, passes a validated acquisition's fields and one
of its own claims.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2e4c481 narrowed ClaimProjection's codec check to last_seq, so
ClaimProjection(1, []) now fails with AttributeError instead of
MalformedRecord and test_exact_incarnation_and_generation_fence_releases
went red on main. Every builder in src passes a dict; the assertion pinned
a check that no longer exists, and the field comment claiming the codec
checks the container is corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim

trissim commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebuild on a copy of the live bus (19,503 records, BusProjectionTables.reset_schema, unprofiled, base 791e5a2 and this branch alternating):

round base this branch
1 18.15 s 16.01 s
2 17.44 s 15.16 s
3 16.71 s 15.35 s

Median 17.44 s → 15.35 s (−2.1 s), from dropping ClaimOwner's per-owner FieldCodec round trip.

Projection rows: sorted dump of all 11 projection tables (164,897 lines) has sha256 822b04d4cf41ce39… for every base and branch run; cmp is identical in all three rounds.

The 47.6 s figure from the earlier profile was inflated by cProfile; this rebuild costs about 17 s unprofiled. It is triggered only when a producing class changes, which happened 14 times in 481 merges since 10-20.

The second commit fixes main's red test_exact_incarnation_and_generation_fence_releases: 2e4c481 deliberately stopped checking ClaimProjection's container, and the test still asserted that check.

@trissim
trissim marked this pull request as ready for review October 23, 2026 12:54
Copilot AI balanced review requested due to automatic review settings October 23, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim trissim closed this Oct 23, 2026
@trissim trissim reopened this Oct 23, 2026
@github-actions

Copy link
Copy Markdown

debt-src at 5f50a12, every finding:

grew TypeErrors:src/agent_comms/typed_table.py +1

Ratchet test and others added 2 commits October 23, 2026 09:04
The producing capability's classes (Message, Claimed, BusCapability) are not
DeclaredFamily members, so the owner set holds plain classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim merged commit fda40b5 into main Oct 23, 2026
6 of 8 checks passed
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.

2 participants