Skip to content

Spec 0004 amended: an ordinary key view use commits no step - #31

Merged
matthewjones372 merged 1 commit into
mainfrom
spec-0004-amendment
Nov 24, 2026
Merged

matthewjones372 merged 1 commit into
mainfrom
spec-0004-amendment

Conversation

@matthewjones372

Copy link
Copy Markdown
Contributor

Spec only, no code.

Why an amendment

Entries 1 and 2 (#29, #30) shipped and were measured. One KeyView.using went from four committed steps to three, and it is not enough.

Doorlist's CipherBench, changed locally to seal through generation-pinned rings so each seal uses a view, p50 on a heavily loaded eight-core machine:

Seal No view View, four steps View, three steps
1 thread 2.2 µs 5.5 to 6.5 µs 4.5 to 5.7 µs
8 threads, one owner 2.3 µs 11.3 to 11.5 µs 9.0 to 11.7 µs
8 threads, eight owners 2.2 µs did not finish 8.0 to 8.8 µs

p99 was not steady enough under that load to report. The budget is p99 at most 20 µs, and the typical seal at eight callers is already near 10.

What changes in the spec

  • Withdrawn: entry 3 as first written. A count kept in Shared needs a step to add and a step to take away, so it would have raised three steps to four. My miscount.
  • New entry 3, key-callers-atomic-count: caller admission by an atomic count, no committed step. Ceiling two.
  • New entry 4, key-material-uses-outside-steps: uses tracked in atomics. Ceiling zero for an ordinary use.
  • Entries 1 and 2 ticked and linked.

Spec 0265's promises and the public API are unchanged. Borrowing, closing, forgetting and revoking stay committed steps.

Open questions

All five answered by the owner on 24 November 2026, each as recommended. Question 2, how to prove two races that takingTurns cannot interleave, carries a stop condition: an entry that cannot pin its race down says so, and a seam in core becomes its own spec.

🤖 Generated with Claude Code

Entries 1 and 2 shipped and were measured through Doorlist's cipher
benchmark on generation-pinned rings: at eight callers a typical seal is
near 10 us with a view against 2.3 us without, on three steps as on four.
Shedding one step at a time will not meet a p99 budget of 20 us.

The amendment withdraws entry 3 as first written (a count kept in Shared
would have raised three steps to four) and replaces it with two entries
that move per-use bookkeeping onto JDK atomics, so an ordinary use commits
nothing. Spec 0265's promises and the public API are unchanged.

Open questions answered by the owner, 24 November 2026.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@matthewjones372
matthewjones372 merged commit 85415ff into main Nov 24, 2026
1 check 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.

1 participant