From c4d90ea955fe0c49ae53b99b38b254de58f1edd1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 05:17:32 +0000 Subject: [PATCH 1/4] Client: read the page host, run budgets, text class and v0.4 era from declarations The client's last fixed numbers outside the engine's coordinates go to the modules that state them: the page worker's host and what a run is granted (Uorc.Host.Declared, a declared host the figures check reports apart from the register), the ASCII text class built from the code table's shape (Uorc.Wire.Text), the v0.4 portfolio's family ids and window depth (Uorc.Wire.Portfolio), and the raw archive's length from its own header and the digest width (Uorc.Wire.Word::digestBytes). Register 3,781 -> 3,757; Client.lex.tex 32 -> 8 (family, textFrame, policy: the engine's coordinates). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013Asa3LzgnA6Pz4jrM6Qz1i --- client/src/Uorc/Client.lex.tex | 21 ++++++----- crates/figures/src/lib.rs | 16 ++++++++ crates/figures/src/sources.rs | 22 ++++++++++- crates/uorc/src/performance.rs | 12 +++++- model/figures.toml | 47 +---------------------- src/Uorc/Host/Declared.lex.tex | 40 ++++++++++++++++++++ src/Uorc/Wire/Portfolio.lex.tex | 16 ++++++++ src/Uorc/Wire/Text.lex.tex | 66 +++++++++++++++++++++++++++++++++ src/Uorc/Wire/Word.lex.tex | 18 +++++++++ 9 files changed, 200 insertions(+), 58 deletions(-) create mode 100644 src/Uorc/Host/Declared.lex.tex create mode 100644 src/Uorc/Wire/Portfolio.lex.tex create mode 100644 src/Uorc/Wire/Text.lex.tex diff --git a/client/src/Uorc/Client.lex.tex b/client/src/Uorc/Client.lex.tex index 8477dedc..73420038 100644 --- a/client/src/Uorc/Client.lex.tex +++ b/client/src/Uorc/Client.lex.tex @@ -3,6 +3,9 @@ \importmodule{Uorc.Core.Resources} \importmodule{Uorc.Wire.Frame} \importmodule{Uorc.Wire.Word} +\importmodule{Uorc.Wire.Text} +\importmodule{Uorc.Wire.Portfolio} +\importmodule{Uorc.Host.Declared} \importmodule{Uorc.Search.Identity} \importmodule{Uorc.Search.Schedule} \importmodule{Uorc.Search.Effort} @@ -40,7 +43,7 @@ name: query, parameters: [input : Bytes], result: Uorc.Search.Identity::Snapshot, - body: (record Uorc.Search.Identity::Snapshot {archiveFormat := (Uorc.Wire.Frame::formatVersion), machineProfile := (Uorc.Wire.Frame::machineProfile), scope := (ctor Uorc.Wire.Frame::Scope.selfContained), objectLengths := (cons (prim length input : Nat) (nil Nat)), target := (Uorc.Core.Bytes::fromBytes input), basis := (nil Uorc.Core.Bytes::Rope), budget := (record Uorc.Core.Resources::Budget {maxSteps := 1099511627776, maxLiveCells := 1099511627776, maxOutputBytes := 1099511627776, maxFrames := 1048576}), objective := (ctor Uorc.Search.Identity::Objective.wireLengthThenUnsignedLex)}), + body: (record Uorc.Search.Identity::Snapshot {archiveFormat := (Uorc.Wire.Frame::formatVersion), machineProfile := (Uorc.Wire.Frame::machineProfile), scope := (ctor Uorc.Wire.Frame::Scope.selfContained), objectLengths := (cons (prim length input : Nat) (nil Nat)), target := (Uorc.Core.Bytes::fromBytes input), basis := (nil Uorc.Core.Bytes::Rope), budget := (record Uorc.Core.Resources::Budget {maxSteps := (Uorc.Host.Declared::runWork), maxLiveCells := (Uorc.Host.Declared::runWork), maxOutputBytes := (Uorc.Host.Declared::runWork), maxFrames := (Uorc.Host.Declared::runFrames)}), objective := (ctor Uorc.Search.Identity::Objective.wireLengthThenUnsignedLex)}), axioms: [] } @@ -56,7 +59,7 @@ name: allowances, parameters: [steps : Nat], result: Uorc.Search.Effort::Allowances, - body: (record Uorc.Search.Effort::Allowances {search := steps, rawReserve := 1099511627776, finalReserve := 1099511627776, replay := 1099511627776, certificateProduction := 0, checker := 1099511627776}), + body: (record Uorc.Search.Effort::Allowances {search := steps, rawReserve := (Uorc.Host.Declared::runWork), finalReserve := (Uorc.Host.Declared::runWork), replay := (Uorc.Host.Declared::runWork), certificateProduction := 0, checker := (Uorc.Host.Declared::runWork)}), axioms: [] } @@ -107,7 +110,7 @@ name: rawLength, parameters: [n : Nat], result: Nat, - body: ((prim multiply 2 (prim length (Uorc.Codec.Archive::number n) : Nat) : Nat) + (n + 41)), + body: ((prim subtract (prim length (Uorc.Codec.Archive::preimage 0x00 n 0x) : Nat) (prim length (Uorc.Codec.Archive::number 0) : Nat) : Nat) + ((prim length (Uorc.Codec.Archive::number n) : Nat) + (n + (Uorc.Wire.Word::digestBytes)))), axioms: [] } @@ -117,7 +120,7 @@ result: Nat, body: (match fuel | Nat.zero => acc - | Nat.succ m => (let b : Nat := (Uorc.Codec.Archive::byteAt data at); (printableFrom m data (at + 1) (if ((((b =? 9) || (b =? 10)) || (b =? 13)) || ((32 <=? b) && (b (let b : Nat := (Uorc.Codec.Archive::byteAt data at); (printableFrom m data (at + 1) (if (Uorc.Wire.Text::printable b) then (acc + 1) else acc)))), axioms: [Quot.sound, propext], recursive_argument: fuel } @@ -228,7 +231,7 @@ name: v04Pair, parameters: [fam : Nat], result: Bytes, - body: (if (fam =? 0) then 0xffff010000ffff0f0000 else (if (fam =? 1) then 0xffff010000ffff070000 else (if (fam =? 2) then 0xffff078000ffff0f0000 else 0xffff0f0000ffff070000))), + body: (if (fam =? (Uorc.Wire.Portfolio::familySmall)) then 0xffff010000ffff0f0000 else (if (fam =? (Uorc.Wire.Portfolio::familyMid)) then 0xffff010000ffff070000 else (if (fam =? (Uorc.Wire.Portfolio::familyX86)) then 0xffff078000ffff0f0000 else 0xffff0f0000ffff070000))), axioms: [] } definition{ @@ -359,7 +362,7 @@ name: hostMemory, parameters: [], result: Nat, - body: 536870912, + body: (Uorc.Host.Declared::pageWorkerMemory), axioms: [] } @@ -376,7 +379,7 @@ name: pageBytes, parameters: [n : Nat, held : Nat, modelled : Nat, profile : Nat, tb : Nat], result: Nat, - body: (let mb : Nat := (Uorc.Codec.NcmEncode::mbOf modelled profile); (let tables : Nat := (tableBytes tb mb profile); ((prim multiply 2 tables : Nat) + ((prim multiply 2 n : Nat) + held)))), + body: (let mb : Nat := (Uorc.Codec.NcmEncode::mbOf modelled profile); (let tables : Nat := (tableBytes tb mb profile); (tables + ((if (Uorc.Host.Declared::pageKeepsTables) then tables else 0) + (n + (n + held)))))), axioms: [] } @@ -559,7 +562,7 @@ result: (List Bytes), body: (match window | List.nil => (nil Bytes) - | List.cons oldest rest => (if ((Uorc.Codec.Archive::windowCount (cons oldest rest)) <=? 2) then (cons oldest rest) else (recentWindow rest))), + | List.cons oldest rest => (if ((Uorc.Codec.Archive::windowCount (cons oldest rest)) <=? (Uorc.Wire.Portfolio::v04WindowFrames)) then (cons oldest rest) else (recentWindow rest))), axioms: [], recursive_argument: window } @@ -776,7 +779,7 @@ name: decodeQuery, parameters: [lengths : (List Nat), scope : Uorc.Wire.Frame::Scope, basis : (List Uorc.Core.Bytes::Rope)], result: Uorc.Search.Identity::Snapshot, - body: (record Uorc.Search.Identity::Snapshot {archiveFormat := (Uorc.Wire.Frame::formatVersion), machineProfile := (Uorc.Wire.Frame::machineProfile), scope := scope, objectLengths := lengths, target := (ctor Uorc.Core.Bytes::Rope.empty), basis := basis, budget := (record Uorc.Core.Resources::Budget {maxSteps := 1099511627776, maxLiveCells := 1099511627776, maxOutputBytes := 1099511627776, maxFrames := 1048576}), objective := (ctor Uorc.Search.Identity::Objective.wireLengthThenUnsignedLex)}), + body: (record Uorc.Search.Identity::Snapshot {archiveFormat := (Uorc.Wire.Frame::formatVersion), machineProfile := (Uorc.Wire.Frame::machineProfile), scope := scope, objectLengths := lengths, target := (ctor Uorc.Core.Bytes::Rope.empty), basis := basis, budget := (record Uorc.Core.Resources::Budget {maxSteps := (Uorc.Host.Declared::runWork), maxLiveCells := (Uorc.Host.Declared::runWork), maxOutputBytes := (Uorc.Host.Declared::runWork), maxFrames := (Uorc.Host.Declared::runFrames)}), objective := (ctor Uorc.Search.Identity::Objective.wireLengthThenUnsignedLex)}), axioms: [] } diff --git a/crates/figures/src/lib.rs b/crates/figures/src/lib.rs index de757992..e1635b9b 100644 --- a/crates/figures/src/lib.rs +++ b/crates/figures/src/lib.rs @@ -36,6 +36,12 @@ //! generator, so a numeral it names is an identity only where a wire module //! states the same name and value (`Uorc.Wire.Coder`); any other is a fixed //! figure the generator named, counted once at its definition. +//! - a *declared host*: a property of a host the product declares it runs +//! on (the page's worker, what a run is granted). In the model, a +//! parameterless numeral of a host declaration module (`Uorc.Host.*`) is +//! such a statement: the input a facet is derived from, not a figure the +//! implementation fixes. It is reported, by name, apart from the register, +//! and every reader takes the host from that one declaration. //! - a *fixed figure*: every other literal. Its site is listed in the register //! (`model/figures.toml`). A constant whose documentation names //! `Facet: ` attributes its sites to that facet record of @@ -115,6 +121,8 @@ pub struct Scan { pub bindings: Vec, /// Generated files and the source each names. pub generated: Vec<(String, String)>, + /// Declared-host statements (`Uorc.Host.*`; not in `sites`). + pub declared: Vec, /// Files read. pub files: usize, } @@ -956,6 +964,14 @@ pub fn summary(o: &Outcome) -> String { "format identities bound to the wire model: {}", o.scan.bindings.len() ); + let _ = writeln!( + s, + "declared host statements (Uorc.Host.*): {}", + o.scan.declared.len() + ); + for d in &o.scan.declared { + let _ = writeln!(s, " {} = {} ({})", d.item, d.value, d.file); + } s } diff --git a/crates/figures/src/sources.rs b/crates/figures/src/sources.rs index 46b605c1..36d7c233 100644 --- a/crates/figures/src/sources.rs +++ b/crates/figures/src/sources.rs @@ -390,11 +390,14 @@ pub fn stated( /// (`Uorc.Codec.*`) is written by a generator, so its named numerals are /// identities only where the wire model states them ([`stated`]: a wire /// module defines the same name with the same value); any other is a fixed -/// figure the generator named, counted once at its definition. +/// figure the generator named, counted once at its definition. A +/// parameterless `Nat` numeral of a host declaration module (`Uorc.Host.*`) +/// is a declared host: listed in `scan.declared`, not counted as a figure. pub fn scan_lean(file: &str, module: &str, text: &str, stated: &Stated, scan: &mut Scan) { scan.files += 1; let wire = module.starts_with("Uorc.Wire."); let coder = module.starts_with("Uorc.Codec."); + let host = module.starts_with("Uorc.Host."); for decl in text.split("definition{").skip(1) { let decl = decl.split("\n}").next().unwrap_or(decl); let name = crate::field(decl, "name") @@ -404,6 +407,17 @@ pub fn scan_lean(file: &str, module: &str, text: &str, stated: &Stated, scan: &m let named = body.is_some() && decl.contains("parameters: [],") && crate::field(decl, "result") == Some("Nat"); + if named && host { + if let Some(v) = body.filter(|v| *v > 1) { + scan.declared.push(Site { + file: file.to_string(), + item: name, + value: v.to_string(), + facet: None, + }); + } + continue; + } if named && (wire || (coder @@ -515,6 +529,12 @@ mod tests { 2, "outside a wire module a named numeral is a figure" ); + let mut s = Scan::default(); + scan_lean("h.lex.tex", "Uorc.Host.Declared", src, &Stated::new(), &mut s); + let got: Vec<_> = s.sites.iter().map(|s| s.value.as_str()).collect(); + assert_eq!(got, ["17"], "a host declaration states its numerals, not its uses"); + let declared: Vec<_> = s.declared.iter().map(|s| (s.item.as_str(), s.value.as_str())).collect(); + assert_eq!(declared, [("v", "2")]); } #[test] diff --git a/crates/uorc/src/performance.rs b/crates/uorc/src/performance.rs index 167741f9..e3429245 100644 --- a/crates/uorc/src/performance.rs +++ b/crates/uorc/src/performance.rs @@ -426,8 +426,16 @@ mod tests { fn page_worker_is_the_pages_host_rule() { let per_gib = stated("../../src/Uorc/Page.lex.tex", "pageWorker", "workersPerGiB"); assert_eq!(super::WORKERS_PER_GIB, per_gib); - let client = stated("../../client/src/Uorc/Client.lex.tex", "hostMemory", ""); - assert_eq!(super::PAGE_WORKER.memory, client); + // the client reads the page worker the host declaration states + // (`Uorc.Host.Declared`): 1 GiB over the same workers per GiB + let declared = stated("../../src/Uorc/Host/Declared.lex.tex", "pageWorkersPerGiB", ""); + assert_eq!(super::WORKERS_PER_GIB, declared); + let client = std::fs::read_to_string( + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("../../client/src/Uorc/Client.lex.tex"), + ) + .expect("the client model"); + assert!(client.contains("body: (Uorc.Host.Declared::pageWorkerMemory),")); let gate = stated("../../src/Uorc/Page.lex.tex", "workerMemory", "threshold"); assert_eq!(super::PAGE_WORKER.memory, gate << 20); let threads = stated("../../src/Uorc/Page.lex.tex", "pageWorker", "frameThreads"); diff --git a/model/figures.toml b/model/figures.toml index e3ae763e..7d342398 100644 --- a/model/figures.toml +++ b/model/figures.toml @@ -4,69 +4,24 @@ # any listing the implementation no longer holds; the writer never raises a count. schema = "uorc/figures/1" -sites = 3781 +sites = 3757 under_facets = 7 -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "allowances" -values = { "1099511627776" = 4 } - -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "decodeQuery" -values = { "1048576" = 1, "1099511627776" = 3 } - [[item]] file = "client/src/Uorc/Client.lex.tex" item = "family" values = { "2" = 1, "3" = 1, "4" = 1, "4096" = 1, "65536" = 1 } -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "hostMemory" -values = { "536870912" = 1 } - -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "pageBytes" -values = { "2" = 2 } - [[item]] file = "client/src/Uorc/Client.lex.tex" item = "policy" values = { "64" = 1 } -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "printableFrom" -values = { "9" = 1, "10" = 1, "13" = 1, "32" = 1, "127" = 1 } - -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "query" -values = { "1048576" = 1, "1099511627776" = 3 } - -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "rawLength" -values = { "2" = 1, "41" = 1 } - -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "recentWindow" -values = { "2" = 1 } - [[item]] file = "client/src/Uorc/Client.lex.tex" item = "textFrame" values = { "9" = 1, "10" = 1 } -[[item]] -file = "client/src/Uorc/Client.lex.tex" -item = "v04Pair" -values = { "2" = 1 } - [[item]] file = "client/src/Uorc/Codec/Archive.lex.tex" item = "byteAt" diff --git a/src/Uorc/Host/Declared.lex.tex b/src/Uorc/Host/Declared.lex.tex new file mode 100644 index 00000000..47a72f40 --- /dev/null +++ b/src/Uorc/Host/Declared.lex.tex @@ -0,0 +1,40 @@ +\begin{lexlean}{Uorc.Host.Declared} +\importmodule{Uorc.Wire.Word} +\title{Parameters} +\begin{semanticmodule} +definition{ + name: kibi, + parameters: [], + result: Nat, + body: (Uorc.Wire.Word::power (Uorc.Wire.Word::bitRange) ((Uorc.Wire.Word::bitRange) + (Uorc.Wire.Word::byteBits))), + axioms: [], + executable: true +} + +definition{ + name: gibi, + parameters: [], + result: Nat, + body: (Uorc.Wire.Word::power (kibi) (1 + (Uorc.Wire.Word::bitRange))), + axioms: [], + executable: true +} + +definition{name: pageWorkersPerGiB, parameters: [], result: Nat, body: 2, axioms: [], executable: true} + +definition{ + name: pageWorkerMemory, + parameters: [], + result: Nat, + body: (prim quotient (gibi) (pageWorkersPerGiB) 0 : Nat), + axioms: [], + executable: true +} + +definition{name: pageKeepsTables, parameters: [], result: Bool, body: true, axioms: [], executable: true} + +definition{name: runWork, parameters: [], result: Nat, body: 1099511627776, axioms: [], executable: true} + +definition{name: runFrames, parameters: [], result: Nat, body: 1048576, axioms: [], executable: true} +\end{semanticmodule} +\end{lexlean} diff --git a/src/Uorc/Wire/Portfolio.lex.tex b/src/Uorc/Wire/Portfolio.lex.tex new file mode 100644 index 00000000..1d262687 --- /dev/null +++ b/src/Uorc/Wire/Portfolio.lex.tex @@ -0,0 +1,16 @@ +\begin{lexlean}{Uorc.Wire.Portfolio} +\title{Parameters} +\begin{semanticmodule} +definition{name: familySmall, parameters: [], result: Nat, body: 0, axioms: [], executable: true} + +definition{name: familyMid, parameters: [], result: Nat, body: (1 + (familySmall)), axioms: [], executable: true} + +definition{name: familyX86, parameters: [], result: Nat, body: (1 + (familyMid)), axioms: [], executable: true} + +definition{name: familyText, parameters: [], result: Nat, body: (1 + (familyX86)), axioms: [], executable: true} + +definition{name: familyOther, parameters: [], result: Nat, body: (1 + (familyText)), axioms: [], executable: true} + +definition{name: v04WindowFrames, parameters: [], result: Nat, body: (1 + 1), axioms: [], executable: true} +\end{semanticmodule} +\end{lexlean} diff --git a/src/Uorc/Wire/Text.lex.tex b/src/Uorc/Wire/Text.lex.tex new file mode 100644 index 00000000..8a10322a --- /dev/null +++ b/src/Uorc/Wire/Text.lex.tex @@ -0,0 +1,66 @@ +\begin{lexlean}{Uorc.Wire.Text} +\importmodule{Uorc.Wire.Word} +\title{Parameters} +\begin{semanticmodule} +definition{ + name: asciiRows, + parameters: [], + result: Nat, + body: (Uorc.Wire.Word::power (Uorc.Wire.Word::bitRange) (Uorc.Wire.Word::profileWordBytes)), + axioms: [], + executable: true +} + +definition{ + name: asciiColumns, + parameters: [], + result: Nat, + body: (Uorc.Wire.Word::power (Uorc.Wire.Word::bitRange) (1 + (Uorc.Wire.Word::bitRange))), + axioms: [], + executable: true +} + +definition{ + name: graphicFirst, + parameters: [], + result: Nat, + body: (prim multiply (Uorc.Wire.Word::bitRange) (asciiRows) : Nat), + axioms: [], + executable: true +} + +definition{ + name: asciiDelete, + parameters: [], + result: Nat, + body: (prim subtract (prim multiply (asciiColumns) (asciiRows) : Nat) 1 : Nat), + axioms: [], + executable: true +} + +definition{name: lineControls, parameters: [], result: Bytes, body: 0x090a0d, axioms: [], executable: true} + +definition{ + name: within, + parameters: [fuel : Nat, members : Bytes, at : Nat, b : Nat], + result: Bool, + body: (match fuel + | Nat.zero => false + | Nat.succ m => (match (prim index members at : (Option UInt8)) + | Option.none => false + | Option.some octet => (((prim to_nat octet : Nat) =? b) || (within m members (1 + at) b)))), + axioms: [Quot.sound, propext], + executable: true, + recursive_argument: fuel +} + +definition{ + name: printable, + parameters: [b : Nat], + result: Bool, + body: ((within (prim length (lineControls) : Nat) (lineControls) 0 b) || (((graphicFirst) <=? b) && (b Date: Mon, 16 Nov 2026 05:42:35 +0000 Subject: [PATCH 2/4] Client: keep the page worker share and run budgets counted; derive only what derives The declared-host kind admitted chosen budgets (2 workers per GiB, 2^40 of work and 2^20 frames per run) as host facts, so it is gone: the run budgets stay where they were, counted, and the workers per GiB is one counted site in Client from which hostMemory is derived. The ASCII line controls are named wire identities of Uorc.Wire.Text. Register 3,781 -> 3,770. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013Asa3LzgnA6Pz4jrM6Qz1i --- client/src/Uorc/Client.lex.tex | 15 ++++++----- crates/figures/src/lib.rs | 16 ------------ crates/figures/src/sources.rs | 22 +--------------- crates/uorc/src/performance.rs | 14 +++------- model/figures.toml | 22 +++++++++++++++- src/Uorc/Host/Declared.lex.tex | 40 ----------------------------- src/Uorc/Wire/Portfolio.lex.tex | 45 +++++++++++++++++++++++++++++---- src/Uorc/Wire/Text.lex.tex | 23 ++++++++--------- 8 files changed, 85 insertions(+), 112 deletions(-) delete mode 100644 src/Uorc/Host/Declared.lex.tex diff --git a/client/src/Uorc/Client.lex.tex b/client/src/Uorc/Client.lex.tex index 73420038..0fe43671 100644 --- a/client/src/Uorc/Client.lex.tex +++ b/client/src/Uorc/Client.lex.tex @@ -5,7 +5,6 @@ \importmodule{Uorc.Wire.Word} \importmodule{Uorc.Wire.Text} \importmodule{Uorc.Wire.Portfolio} -\importmodule{Uorc.Host.Declared} \importmodule{Uorc.Search.Identity} \importmodule{Uorc.Search.Schedule} \importmodule{Uorc.Search.Effort} @@ -43,7 +42,7 @@ name: query, parameters: [input : Bytes], result: Uorc.Search.Identity::Snapshot, - body: (record Uorc.Search.Identity::Snapshot {archiveFormat := (Uorc.Wire.Frame::formatVersion), machineProfile := (Uorc.Wire.Frame::machineProfile), scope := (ctor Uorc.Wire.Frame::Scope.selfContained), objectLengths := (cons (prim length input : Nat) (nil Nat)), target := (Uorc.Core.Bytes::fromBytes input), basis := (nil Uorc.Core.Bytes::Rope), budget := (record Uorc.Core.Resources::Budget {maxSteps := (Uorc.Host.Declared::runWork), maxLiveCells := (Uorc.Host.Declared::runWork), maxOutputBytes := (Uorc.Host.Declared::runWork), maxFrames := (Uorc.Host.Declared::runFrames)}), objective := (ctor Uorc.Search.Identity::Objective.wireLengthThenUnsignedLex)}), + body: (record Uorc.Search.Identity::Snapshot {archiveFormat := (Uorc.Wire.Frame::formatVersion), machineProfile := (Uorc.Wire.Frame::machineProfile), scope := (ctor Uorc.Wire.Frame::Scope.selfContained), objectLengths := (cons (prim length input : Nat) (nil Nat)), target := (Uorc.Core.Bytes::fromBytes input), basis := (nil Uorc.Core.Bytes::Rope), budget := (record Uorc.Core.Resources::Budget {maxSteps := 1099511627776, maxLiveCells := 1099511627776, maxOutputBytes := 1099511627776, maxFrames := 1048576}), objective := (ctor Uorc.Search.Identity::Objective.wireLengthThenUnsignedLex)}), axioms: [] } @@ -59,7 +58,7 @@ name: allowances, parameters: [steps : Nat], result: Uorc.Search.Effort::Allowances, - body: (record Uorc.Search.Effort::Allowances {search := steps, rawReserve := (Uorc.Host.Declared::runWork), finalReserve := (Uorc.Host.Declared::runWork), replay := (Uorc.Host.Declared::runWork), certificateProduction := 0, checker := (Uorc.Host.Declared::runWork)}), + body: (record Uorc.Search.Effort::Allowances {search := steps, rawReserve := 1099511627776, finalReserve := 1099511627776, replay := 1099511627776, certificateProduction := 0, checker := 1099511627776}), axioms: [] } @@ -358,14 +357,18 @@ recursive_argument: scheduled } +definition{name: pageWorkersPerGiB, parameters: [], result: Nat, body: 2, axioms: []} + definition{ name: hostMemory, parameters: [], result: Nat, - body: (Uorc.Host.Declared::pageWorkerMemory), + body: (prim quotient (Uorc.Wire.Word::power (Uorc.Wire.Word::power (Uorc.Wire.Word::bitRange) ((Uorc.Wire.Word::bitRange) + (Uorc.Wire.Word::byteBits))) (1 + (Uorc.Wire.Word::bitRange))) (pageWorkersPerGiB) 0 : Nat), axioms: [] } +definition{name: hostKeepsTables, parameters: [], result: Bool, body: true, axioms: []} + definition{ name: tableBytes, parameters: [tb : Nat, mb : Nat, profile : Nat], @@ -379,7 +382,7 @@ name: pageBytes, parameters: [n : Nat, held : Nat, modelled : Nat, profile : Nat, tb : Nat], result: Nat, - body: (let mb : Nat := (Uorc.Codec.NcmEncode::mbOf modelled profile); (let tables : Nat := (tableBytes tb mb profile); (tables + ((if (Uorc.Host.Declared::pageKeepsTables) then tables else 0) + (n + (n + held)))))), + body: (let mb : Nat := (Uorc.Codec.NcmEncode::mbOf modelled profile); (let tables : Nat := (tableBytes tb mb profile); (tables + ((if (hostKeepsTables) then tables else 0) + (n + (n + held)))))), axioms: [] } @@ -779,7 +782,7 @@ name: decodeQuery, parameters: [lengths : (List Nat), scope : Uorc.Wire.Frame::Scope, basis : (List Uorc.Core.Bytes::Rope)], result: Uorc.Search.Identity::Snapshot, - body: (record Uorc.Search.Identity::Snapshot {archiveFormat := (Uorc.Wire.Frame::formatVersion), machineProfile := (Uorc.Wire.Frame::machineProfile), scope := scope, objectLengths := lengths, target := (ctor Uorc.Core.Bytes::Rope.empty), basis := basis, budget := (record Uorc.Core.Resources::Budget {maxSteps := (Uorc.Host.Declared::runWork), maxLiveCells := (Uorc.Host.Declared::runWork), maxOutputBytes := (Uorc.Host.Declared::runWork), maxFrames := (Uorc.Host.Declared::runFrames)}), objective := (ctor Uorc.Search.Identity::Objective.wireLengthThenUnsignedLex)}), + body: (record Uorc.Search.Identity::Snapshot {archiveFormat := (Uorc.Wire.Frame::formatVersion), machineProfile := (Uorc.Wire.Frame::machineProfile), scope := scope, objectLengths := lengths, target := (ctor Uorc.Core.Bytes::Rope.empty), basis := basis, budget := (record Uorc.Core.Resources::Budget {maxSteps := 1099511627776, maxLiveCells := 1099511627776, maxOutputBytes := 1099511627776, maxFrames := 1048576}), objective := (ctor Uorc.Search.Identity::Objective.wireLengthThenUnsignedLex)}), axioms: [] } diff --git a/crates/figures/src/lib.rs b/crates/figures/src/lib.rs index e1635b9b..de757992 100644 --- a/crates/figures/src/lib.rs +++ b/crates/figures/src/lib.rs @@ -36,12 +36,6 @@ //! generator, so a numeral it names is an identity only where a wire module //! states the same name and value (`Uorc.Wire.Coder`); any other is a fixed //! figure the generator named, counted once at its definition. -//! - a *declared host*: a property of a host the product declares it runs -//! on (the page's worker, what a run is granted). In the model, a -//! parameterless numeral of a host declaration module (`Uorc.Host.*`) is -//! such a statement: the input a facet is derived from, not a figure the -//! implementation fixes. It is reported, by name, apart from the register, -//! and every reader takes the host from that one declaration. //! - a *fixed figure*: every other literal. Its site is listed in the register //! (`model/figures.toml`). A constant whose documentation names //! `Facet: ` attributes its sites to that facet record of @@ -121,8 +115,6 @@ pub struct Scan { pub bindings: Vec, /// Generated files and the source each names. pub generated: Vec<(String, String)>, - /// Declared-host statements (`Uorc.Host.*`; not in `sites`). - pub declared: Vec, /// Files read. pub files: usize, } @@ -964,14 +956,6 @@ pub fn summary(o: &Outcome) -> String { "format identities bound to the wire model: {}", o.scan.bindings.len() ); - let _ = writeln!( - s, - "declared host statements (Uorc.Host.*): {}", - o.scan.declared.len() - ); - for d in &o.scan.declared { - let _ = writeln!(s, " {} = {} ({})", d.item, d.value, d.file); - } s } diff --git a/crates/figures/src/sources.rs b/crates/figures/src/sources.rs index 36d7c233..46b605c1 100644 --- a/crates/figures/src/sources.rs +++ b/crates/figures/src/sources.rs @@ -390,14 +390,11 @@ pub fn stated( /// (`Uorc.Codec.*`) is written by a generator, so its named numerals are /// identities only where the wire model states them ([`stated`]: a wire /// module defines the same name with the same value); any other is a fixed -/// figure the generator named, counted once at its definition. A -/// parameterless `Nat` numeral of a host declaration module (`Uorc.Host.*`) -/// is a declared host: listed in `scan.declared`, not counted as a figure. +/// figure the generator named, counted once at its definition. pub fn scan_lean(file: &str, module: &str, text: &str, stated: &Stated, scan: &mut Scan) { scan.files += 1; let wire = module.starts_with("Uorc.Wire."); let coder = module.starts_with("Uorc.Codec."); - let host = module.starts_with("Uorc.Host."); for decl in text.split("definition{").skip(1) { let decl = decl.split("\n}").next().unwrap_or(decl); let name = crate::field(decl, "name") @@ -407,17 +404,6 @@ pub fn scan_lean(file: &str, module: &str, text: &str, stated: &Stated, scan: &m let named = body.is_some() && decl.contains("parameters: [],") && crate::field(decl, "result") == Some("Nat"); - if named && host { - if let Some(v) = body.filter(|v| *v > 1) { - scan.declared.push(Site { - file: file.to_string(), - item: name, - value: v.to_string(), - facet: None, - }); - } - continue; - } if named && (wire || (coder @@ -529,12 +515,6 @@ mod tests { 2, "outside a wire module a named numeral is a figure" ); - let mut s = Scan::default(); - scan_lean("h.lex.tex", "Uorc.Host.Declared", src, &Stated::new(), &mut s); - let got: Vec<_> = s.sites.iter().map(|s| s.value.as_str()).collect(); - assert_eq!(got, ["17"], "a host declaration states its numerals, not its uses"); - let declared: Vec<_> = s.declared.iter().map(|s| (s.item.as_str(), s.value.as_str())).collect(); - assert_eq!(declared, [("v", "2")]); } #[test] diff --git a/crates/uorc/src/performance.rs b/crates/uorc/src/performance.rs index e3429245..634c3093 100644 --- a/crates/uorc/src/performance.rs +++ b/crates/uorc/src/performance.rs @@ -426,16 +426,10 @@ mod tests { fn page_worker_is_the_pages_host_rule() { let per_gib = stated("../../src/Uorc/Page.lex.tex", "pageWorker", "workersPerGiB"); assert_eq!(super::WORKERS_PER_GIB, per_gib); - // the client reads the page worker the host declaration states - // (`Uorc.Host.Declared`): 1 GiB over the same workers per GiB - let declared = stated("../../src/Uorc/Host/Declared.lex.tex", "pageWorkersPerGiB", ""); - assert_eq!(super::WORKERS_PER_GIB, declared); - let client = std::fs::read_to_string( - std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("../../client/src/Uorc/Client.lex.tex"), - ) - .expect("the client model"); - assert!(client.contains("body: (Uorc.Host.Declared::pageWorkerMemory),")); + // the client states the same workers per GiB and gives a worker + // 1 GiB over them (`Client.hostMemory`) + let client = stated("../../client/src/Uorc/Client.lex.tex", "pageWorkersPerGiB", ""); + assert_eq!(super::WORKERS_PER_GIB, client); let gate = stated("../../src/Uorc/Page.lex.tex", "workerMemory", "threshold"); assert_eq!(super::PAGE_WORKER.memory, gate << 20); let threads = stated("../../src/Uorc/Page.lex.tex", "pageWorker", "frameThreads"); diff --git a/model/figures.toml b/model/figures.toml index 7d342398..ac08c99c 100644 --- a/model/figures.toml +++ b/model/figures.toml @@ -4,19 +4,39 @@ # any listing the implementation no longer holds; the writer never raises a count. schema = "uorc/figures/1" -sites = 3757 +sites = 3770 under_facets = 7 +[[item]] +file = "client/src/Uorc/Client.lex.tex" +item = "allowances" +values = { "1099511627776" = 4 } + +[[item]] +file = "client/src/Uorc/Client.lex.tex" +item = "decodeQuery" +values = { "1048576" = 1, "1099511627776" = 3 } + [[item]] file = "client/src/Uorc/Client.lex.tex" item = "family" values = { "2" = 1, "3" = 1, "4" = 1, "4096" = 1, "65536" = 1 } +[[item]] +file = "client/src/Uorc/Client.lex.tex" +item = "pageWorkersPerGiB" +values = { "2" = 1 } + [[item]] file = "client/src/Uorc/Client.lex.tex" item = "policy" values = { "64" = 1 } +[[item]] +file = "client/src/Uorc/Client.lex.tex" +item = "query" +values = { "1048576" = 1, "1099511627776" = 3 } + [[item]] file = "client/src/Uorc/Client.lex.tex" item = "textFrame" diff --git a/src/Uorc/Host/Declared.lex.tex b/src/Uorc/Host/Declared.lex.tex deleted file mode 100644 index 47a72f40..00000000 --- a/src/Uorc/Host/Declared.lex.tex +++ /dev/null @@ -1,40 +0,0 @@ -\begin{lexlean}{Uorc.Host.Declared} -\importmodule{Uorc.Wire.Word} -\title{Parameters} -\begin{semanticmodule} -definition{ - name: kibi, - parameters: [], - result: Nat, - body: (Uorc.Wire.Word::power (Uorc.Wire.Word::bitRange) ((Uorc.Wire.Word::bitRange) + (Uorc.Wire.Word::byteBits))), - axioms: [], - executable: true -} - -definition{ - name: gibi, - parameters: [], - result: Nat, - body: (Uorc.Wire.Word::power (kibi) (1 + (Uorc.Wire.Word::bitRange))), - axioms: [], - executable: true -} - -definition{name: pageWorkersPerGiB, parameters: [], result: Nat, body: 2, axioms: [], executable: true} - -definition{ - name: pageWorkerMemory, - parameters: [], - result: Nat, - body: (prim quotient (gibi) (pageWorkersPerGiB) 0 : Nat), - axioms: [], - executable: true -} - -definition{name: pageKeepsTables, parameters: [], result: Bool, body: true, axioms: [], executable: true} - -definition{name: runWork, parameters: [], result: Nat, body: 1099511627776, axioms: [], executable: true} - -definition{name: runFrames, parameters: [], result: Nat, body: 1048576, axioms: [], executable: true} -\end{semanticmodule} -\end{lexlean} diff --git a/src/Uorc/Wire/Portfolio.lex.tex b/src/Uorc/Wire/Portfolio.lex.tex index 1d262687..47a8db9a 100644 --- a/src/Uorc/Wire/Portfolio.lex.tex +++ b/src/Uorc/Wire/Portfolio.lex.tex @@ -3,14 +3,49 @@ \begin{semanticmodule} definition{name: familySmall, parameters: [], result: Nat, body: 0, axioms: [], executable: true} -definition{name: familyMid, parameters: [], result: Nat, body: (1 + (familySmall)), axioms: [], executable: true} +definition{ + name: familyMid, + parameters: [], + result: Nat, + body: (1 + (familySmall)), + axioms: [], + executable: true +} -definition{name: familyX86, parameters: [], result: Nat, body: (1 + (familyMid)), axioms: [], executable: true} +definition{ + name: familyX86, + parameters: [], + result: Nat, + body: (1 + (familyMid)), + axioms: [], + executable: true +} -definition{name: familyText, parameters: [], result: Nat, body: (1 + (familyX86)), axioms: [], executable: true} +definition{ + name: familyText, + parameters: [], + result: Nat, + body: (1 + (familyX86)), + axioms: [], + executable: true +} -definition{name: familyOther, parameters: [], result: Nat, body: (1 + (familyText)), axioms: [], executable: true} +definition{ + name: familyOther, + parameters: [], + result: Nat, + body: (1 + (familyText)), + axioms: [], + executable: true +} -definition{name: v04WindowFrames, parameters: [], result: Nat, body: (1 + 1), axioms: [], executable: true} +definition{ + name: v04WindowFrames, + parameters: [], + result: Nat, + body: (1 + 1), + axioms: [], + executable: true +} \end{semanticmodule} \end{lexlean} diff --git a/src/Uorc/Wire/Text.lex.tex b/src/Uorc/Wire/Text.lex.tex index 8a10322a..6bc8de50 100644 --- a/src/Uorc/Wire/Text.lex.tex +++ b/src/Uorc/Wire/Text.lex.tex @@ -38,27 +38,24 @@ executable: true } -definition{name: lineControls, parameters: [], result: Bytes, body: 0x090a0d, axioms: [], executable: true} +definition{name: horizontalTab, parameters: [], result: Nat, body: 9, axioms: [], executable: true} + +definition{name: lineFeed, parameters: [], result: Nat, body: 10, axioms: [], executable: true} definition{ - name: within, - parameters: [fuel : Nat, members : Bytes, at : Nat, b : Nat], - result: Bool, - body: (match fuel - | Nat.zero => false - | Nat.succ m => (match (prim index members at : (Option UInt8)) - | Option.none => false - | Option.some octet => (((prim to_nat octet : Nat) =? b) || (within m members (1 + at) b)))), - axioms: [Quot.sound, propext], - executable: true, - recursive_argument: fuel + name: carriageReturn, + parameters: [], + result: Nat, + body: 13, + axioms: [], + executable: true } definition{ name: printable, parameters: [b : Nat], result: Bool, - body: ((within (prim length (lineControls) : Nat) (lineControls) 0 b) || (((graphicFirst) <=? b) && (b Date: Mon, 16 Nov 2026 06:23:56 +0000 Subject: [PATCH 3/4] performance: rustfmt the page worker test Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013Asa3LzgnA6Pz4jrM6Qz1i --- crates/uorc/src/performance.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/uorc/src/performance.rs b/crates/uorc/src/performance.rs index 634c3093..47d8f39e 100644 --- a/crates/uorc/src/performance.rs +++ b/crates/uorc/src/performance.rs @@ -428,7 +428,11 @@ mod tests { assert_eq!(super::WORKERS_PER_GIB, per_gib); // the client states the same workers per GiB and gives a worker // 1 GiB over them (`Client.hostMemory`) - let client = stated("../../client/src/Uorc/Client.lex.tex", "pageWorkersPerGiB", ""); + let client = stated( + "../../client/src/Uorc/Client.lex.tex", + "pageWorkersPerGiB", + "", + ); assert_eq!(super::WORKERS_PER_GIB, client); let gate = stated("../../src/Uorc/Page.lex.tex", "workerMemory", "threshold"); assert_eq!(super::PAGE_WORKER.memory, gate << 20); From 41d8dafe17bc962bd2152adebff3f25043abaaa2 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 07:08:14 +0000 Subject: [PATCH 4/4] Wire.Text: printable needs no axioms (LLV7005 is exact) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013Asa3LzgnA6Pz4jrM6Qz1i --- src/Uorc/Wire/Text.lex.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Uorc/Wire/Text.lex.tex b/src/Uorc/Wire/Text.lex.tex index 6bc8de50..f9dfb547 100644 --- a/src/Uorc/Wire/Text.lex.tex +++ b/src/Uorc/Wire/Text.lex.tex @@ -56,7 +56,7 @@ parameters: [b : Nat], result: Bool, body: ((((b =? (horizontalTab)) || (b =? (lineFeed))) || (b =? (carriageReturn))) || (((graphicFirst) <=? b) && (b