Skip to content

Prism model: performance as theorems (Uorc.Performance, UC-PERF-02..09) - #138

Merged
afflom merged 9 commits into
mainfrom
claude/project-thread-5x220g
Nov 11, 2026
Merged

afflom merged 9 commits into
mainfrom
claude/project-thread-5x220g

Conversation

@afflom

@afflom afflom commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Requested by Alex · project thread

v0.5 lane 1 of 5: the universal layer. Uorc.Performance (src/Uorc/Performance.lex.tex) states the client's size, choice, decode cost and meaning as theorems that hold for every input. 45 theorems, each kernel-checked by lexlean verify.

Row Theorem Statement
UC-PERF-02 archiveBound A frame is settled against its raw frame; the raw frame is 2 length varints (at most 10 bytes each), the input and 41 fixed bytes. No one-object frame exceeds n + 61 bytes.
UC-PERF-03 bestNoLargerThanEvery The trial the portfolio keeps is no larger than any coded trial it scheduled.
UC-PERF-04 decodeStepsBound A profile evaluates between 3 and 24 model inputs per bit, so decode takes at most 192 steps per modelled byte for every frame kind (raw, reference, ncm, ncm from a named state). Closed vectors: FULL 192, V03 160 steps per byte.
UC-PERF-05 bestOfAdmittedIsExact Admission fails every trial whose decode differs from the input. Whichever codec point or named state coded a frame, only its size can change.
UC-PERF-06 dominance* "No larger in bytes and in steps" is irreflexive and transitive, never grows either coordinate, and its gain is bounded by the cost drop.
UC-PERF-07 boundedPortfolioSettlesTheSame A trial abandoned at the raw length is a trial of at most that many bytes; the portfolio of abandoned trials settles to the same size as the portfolio of complete ones. A trial no smaller than a kept one changes nothing. Fewer compress steps, same size.
UC-PERF-08 chosenIsLeast, chosenKeepsTheSize, leastIsUndominated Choosing by fewer bytes, then fewer steps, keeps a trial no later than every listed trial and the raw frame, of exactly the size the bytes-only rule settles to, dominated by none of them. Fewer decode steps on byte ties, same size.
UC-PERF-09 consolidationSpendsItsGain, potentialNeverRises Consolidating a candidate lowers bytes plus steps by exactly its gain; over any sequence the potential never rises. An engine that consolidates only dominating candidates never regresses and consolidates finitely often.

Rows 07 to 09 carry over three things the rule30 work established: a finite horizon decides a candidate, a known result is not redone, and a potential that only falls.

What these do and do not say:

  • A step is one model input evaluated for one coded bit. It is exact and read from a frame header alone. It counts model inputs; it is not machine time.
  • The theorems are about the model's rules (keep, best, settle, admitted, decodeSteps, bounded, pick, chosen, consolidate). crates/uorc/tests/performance.rs binds the native client to them, one test per row: native constants equal the model's, the theorem inventory is complete, and on sampled frames (empty, tiny, text, noise, mixed) the native raw frame has the model's length, the kept frame is within n + 61 and no larger than each scheduled strategy's frame, every frame decodes to its input, its step count is within 192 n, and a payload abandoned at a bound is the complete payload or absent. The choice and consolidation functions are checked over every list of small keys.
  • The exported client's own selection is not yet proved to be this module's best, and the released client still breaks byte ties by schedule order. UC-PERF-08 says so; the bytes-then-steps rule and the zero-hit x86 exclusion enter with the next model export (the named-states lane).
  • The size bound is per frame of one object. A stream of k frames is within n + 61 k.
  • By counting, no codec shrinks every input, so these theorems bound the constant, the steps and never-worse. Ratio results are closed claims over a named corpus (v0.5 lane 2: closed performance claims by κ (frontier register, decider, factory obligation, UC-PERF-01 target) #137).

Also here: uorc::performance (step measure, codec point κ, corpus κ, choice and consolidation functions) used by the other v0.5 lanes; a codec point's profile word carries bit 31 for the x86 filter (POINT_X86).

UC-PERF-01 is not touched (#137 changes it). Not to merge before v0.4.0 is tagged.

Checks run locally: lexlean lock --check, fmt --check --all, check --all (343 modules); lexlean verify of the module; xtask check-model (37 ids); cargo clippy --workspace --all-targets -D warnings; cargo test -p uorc --test performance (8 tests); cargo test -p repo-conformance --test bdd.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Asa3LszhHCxmceQ2V8xxx

A step is one model input evaluated for one coded bit, read from a frame
header alone. A codec point names basis, profile word, state and lanes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LszhHCxmceQ2V8xxx
Uorc.Performance (src/Uorc/Performance.lex.tex) states the client's size,
choice, decode cost and meaning as theorems that hold for every input, each
kernel-checked:

- archiveBound: a frame is settled against its raw frame, and the raw frame
  is 2 length varints (at most 10 bytes each), the input and 41 fixed bytes,
  so no one-object frame exceeds n + 61 bytes.
- bestNoLargerThanEvery: the trial the portfolio keeps is no larger than any
  coded trial it scheduled.
- decodeStepsBound: a step is one model input evaluated for one coded bit;
  a profile evaluates between 3 and 24 inputs, so decode takes at most 192
  steps per modelled byte for every frame kind (raw, reference, ncm, ncm
  from a named state). Closed vectors: FULL 192, V03 160 steps per byte.
- bestOfAdmittedIsExact: admission fails every trial whose decode differs
  from the input, so whichever codec point or named state coded a frame,
  only its size can change.
- dominance (no larger in bytes and in steps) is irreflexive, transitive,
  never grows either coordinate, and its gain is bounded by the cost drop,
  so consolidating winners cannot cycle.

The theorems are about the model's rules. tests/performance.rs holds the
native constants equal to the model's, the theorem inventory complete, and
every sampled native frame within the bounds (raw length, n + 61, no larger
than each scheduled strategy, decodes to its input, steps within 192 n).

The codec point's profile word carries bit 31 for the x86 filter
(performance::POINT_X86), the strategy table's encoding.

Registered as UC-PERF-02..06 (kernel_theorem), suite performance-theorems.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LszhHCxmceQ2V8xxx
@afflom afflom self-assigned this Nov 11, 2026
Registry keeps UC-WEB-01 and UC-PERF-02..06; projections regenerated (34 ids).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LszhHCxmceQ2V8xxx
…l (UC-PERF-07..09)

Nineteen more kernel-checked theorems, drawn from what the rule30 work
established (a finite horizon decides a candidate; a known result is not
redone; a potential that only falls):

- boundedPortfolioSettlesTheSame: a trial abandoned at the raw length is a
  trial of at most that many bytes, and the portfolio of abandoned trials
  settles to the same size as the portfolio of complete ones. A trial no
  smaller than a kept one changes neither the kept bytes nor steps.
- chosenIsLeast, chosenIsNoWorseThanRaw, chosenKeepsTheSize,
  leastIsUndominated: choosing by fewer bytes, then fewer steps, keeps a
  trial no later than every listed trial and the raw frame, of exactly the
  size the bytes-only rule settles to, dominated by none of them.
- consolidationSpendsItsGain, potentialNeverRises: consolidating a
  candidate lowers bytes plus steps by exactly its gain, and over any
  sequence the potential never rises.

Native: performance::{Trial, gain, lex_gap, pick, chosen, consolidate},
tested exhaustively over small keys against the theorems' statements; the
encoder's bound returns the complete payload or none.

The released client still breaks byte ties by schedule order; UC-PERF-08
says so. The bytes-then-steps rule enters with the next model export.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LszhHCxmceQ2V8xxx
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LszhHCxmceQ2V8xxx
@afflom afflom changed the title Prism model: performance as theorems (Uorc.Performance, UC-PERF-02..06) Prism model: performance as theorems (Uorc.Performance, UC-PERF-02..09) Nov 11, 2026
@afflom
afflom merged commit f94cce6 into main Nov 11, 2026
17 checks passed
afflom pushed a commit that referenced this pull request Nov 11, 2026
#140 moved the encoder to planned frames and coded strategies, so the
portfolio-as-table commit this branch carried for lane 3 leaves this PR
(lane 3 brings it with the engine). frontier codes a codec point through
uorc::compress_with_strategies over FrameEncoder's planned frames; the
shipped plan writes the shipped stream (tested), and the offline corpus
re-decides to the same claim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3QshCSRwiddS64zU3j
afflom pushed a commit that referenced this pull request Nov 11, 2026
…ine file

Merge main into the product model lane. model.json now reads frontier.toml's
nested [[claim.members]] tables and model/engine.toml as uorc/engine/1
(rule30_state, [[strategy]] words named by [[weight]] index, [[generator]]
weights). The theorems table is labelled for the performance rows it lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3PSU8BqT6iazmFzCy1
afflom pushed a commit that referenced this pull request Nov 11, 2026
compress_pieces and compress_frames take the portfolio table again on
main's per-strategy coding; compress_strategy reads the shipped table.
portfolio::STRATEGIES (decoded from weights.rs at compile time) and
portfolio::plan stay for callers of the shipped portfolio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LeJgXkUvvAfeAGt9A
@afflom afflom mentioned this pull request Nov 12, 2026
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