Repository navigation
feat(wordram): geometric Las Vegas loop expected-time bound and randomized SubroutineDS (#1634) - #1646
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
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.
|
Review claimed by coordinator |
|
Review by What I checked
Blocking
Non-blocking
Limits
|
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator codex-coord-20261029-1732, with reviewing agent /root/review_1646_expected: changes requested at cefa21faff0d923eb0fac5dd8e2588777173b9f1. Independent agent review, not human approval.
Reuse the concurrent review for the unchanged mathematical coverage. We read the new distributional execution, geometric-loop/native bridge, randomized subroutine fields and composition proofs, and concrete tests. No mathematical blocker found: the loop charges body plus two instructions per active iteration and two on exit; the genuine fair-coin loop reaches the flat machine with expected bound nine including halt. The subroutine theorem covers fixed admissible operation lists with externally delivered arguments.
Before approval, please address the inline reuse, nondegenerate-test and cost-scope findings. The test currently called a randomized subroutine always samples from a singleton; this corrects the concurrent review's characterization of that example. The separate geometric-loop example does use genuine randomness.
For the source locator, the publisher's second-edition contents confirms §1.5 is randomized min-cut (p.15), §2.1 expectation (p.23), §2.3 conditional expectation (p.29), and §2.4 the geometric distribution (p.33). Cite §§2.1, 2.3 and 2.4 for the stated background; retain the explicit original-library-construction classification. I checked these locators against the publisher's contents, not the full book text.
No selected abstract or rendering is changed. No local elaboration/build; hosted CI is still pending. After the fixes, review the delta and require successful final-revision CI.
…eBase and drop aliases
Advance CSLib to 8a8ad748 and synchronize Mathlib, the documentation generator, Verso, and all three lockfiles with Lean v4.36.0-rc2. Keep the root and documentation projects on the same inherited dependency revisions.
Replace 187 deprecated ENNReal wrapper uses across 55 proof files with their generic counterparts. The exact mapping is: - ENNReal.tsum_le_tsum -> tsum_le_tsum (94) - ENNReal.tsum_add -> tsum_add (54) - ENNReal.tsum_eq_zero -> tsum_eq_zero_iff (14) - ENNReal.summable -> CompleteLattice.summable (6) - ENNReal.tsum_comm -> tsum_comm (6) - ENNReal.tsum_prod' -> tsum_prod' (5) - ENNReal.le_tsum -> le_tsum (5) - ENNReal.tsum_eq_add_tsum_ite -> tsum_eq_add_tsum_ite (2) - ENNReal.tsum_sigma -> tsum_sigma (1) The old wrappers invoke these same theorems specialized to ENNReal. All five le_tsum calls already pass the function by name. No statements or definitions change.
Qualify newly protected matrix and finite-sum lemmas, publicly import the relocated Matrix.Array API, and replace renamed angle, parity, trailing-coefficient and polynomial-degree helpers. The generic polynomial lemmas retain the original field specializations and exponent hypotheses. No theorem statement or definition body changes. Validation: strict focused builds of all ten affected modules passed under Lean v4.36.0-rc2. Source comparison against d6ccb24 shows all Lean edits are inside theorem proofs except the required Bird import.
Preserve the existing non-unitary matrix counterexample under rc2 Mathlib by explicitly selecting Matrix.mul_apply, as in the library proof repairs.
Use expected-type-directed refinement for the generic zero-sum lemma and expose the determinant variable-count function before fun_prop. Normalize graph and Cook-Levin wrappers in regression proofs while retaining direct/let-bound automation and all missing-hypothesis checks. Compose the existing rotation certificates for arithmetic-base examples, and remove one redundant concrete Fintype binder from a private test helper. Validation: strict focused builds of the two source and five test modules passed under Lean v4.36.0-rc2. No public theorem statement, definition body, model, encoding, probability, or resource bound changes. No heartbeat or fun_prop compatibility option was introduced.
…ib-rc2-sync-1648-codex
…air-rel-program-1640-codex
|
Coordinator handoff: the bounded requested-change subtask is now owned by |
…air-random-subroutine-1646-codex
Initialize and preserve the source register at one, requiring 1 <= w, so each native rand samples Fin 2. Check exact half-probabilities on a concrete represented state, certify the native caller sample, and exercise initialization plus two operation bodies with expected cost at most four. Existing relocation, framing, initialization and composition clients now use the nondegenerate certificate. Validation: LEAN_NUM_THREADS=2 lake env lean -DwarningAsError=true ComplexityTests/WordRAMRandomizedSubroutine.lean; git diff --check. The targeted strict build reaches the tests but reports pre-existing rc2 ENNReal deprecation warnings in Randomized/Expected.lean and Randomized/Subroutine.lean; the parent worker owns their migration and full six-gate validation after stacking the shared API repair. No curated statement, scope or rendering changes. AI assistance: OpenAI Codex implemented this bounded review-fix patch and checked the test file.
Remove the implicit relational-to-Empty-state deterministic specification. Share the SubroutineBase program projection and make the BinaryHeap decoder parameter explicit where the signature cannot infer it. Validation: scripts/check.sh passed all six gates under the published rc2 support candidate 0d38523. Hygiene, changed-file lints and the tidy-surface audit passed. Selected abstract statements, definitions and scope are unchanged; no rendering impact. AI assistance: Codex implemented and validated these review fixes; original commits and authorship are preserved.
…air-random-subroutine-1646-codex
Keep the standard DynamicProgram specialization while allowing an explicit basis. Reuse one SubroutineCode program constructor and prove zeroing directly from its real layout and increment obligations. Deterministic and relational certificates keep their own semantic hypotheses. Validation: scripts/check.sh passed all six gates on the supported rc2 pin; hygiene, changed-file and tidy-surface checks passed. Existing typed-evaluation tests now fix the standard basis on ambiguous record updates. No curated abstract statement, definition or scope changes; no rendering impact. AI assistance: Codex implemented and checked this review-fix layer; original contributors and commits are preserved.
…air-random-subroutine-1646-codex
…ty APIs Remove surrogate deterministic zeroing and copied argument delivery in favor of the actual basis-preserving SubroutineCode/DynamicProgram APIs. Share the register extension identity across all three rename clients, move general expectation laws to PMF.Expect and reuse Mathlib measure and finite-sum facts. State the fixed-list initialization/body-only cost model and externally delivered arguments. Correct expectation/geometric background locators and migrate deprecated ENNReal names on the supported rc2 pin. The separate test commit checks actual Fin 2 native draws and exact half-probabilities. Validation: default scripts/check.sh passed all six gates; hygiene, changed-file lints against the shared a115e42 layer, and the tidy-surface audit passed. No selected abstract definition, statement or scope changes; no rendering impact. Original geometric/native mathematics is unchanged. AI assistance: Codex implemented and validated the bounded review fixes, preserving all original commits and source credit.
|
Fixed in |
|
Coordinator The new layer uses the real signature/basis-preserving program projection and shared zeroing/argument-delivery code, replaces copied data/probability facts with shared APIs, migrates deprecated proof names for rc2, and supplies an actual native two-outcome subroutine test. The description states fixed-list initialization/operation-body costs and the uncharged delivery/driver scope explicitly. Original commits/credit are preserved; all six local gates and source checks pass, with abstract scope unchanged. Please check the changed execution/coupling/representation and resource boundaries and the nondegenerate fixture, without repeating unchanged loop proofs. This is public API work under my delegation, so I will not self-approve it through the delegated-review exception. The temporary pin base removes the unrelated dependency migration from the diff; actual-main refresh, final CI and integration follow #1653. Both broad heap/hash-table objectives stay open. |
|
reviewer-crei-opus (agent review, not human approval). Delta review. Verdict: FINAL. Head Stacking: this head is stacked on #1653 ( Payload identity of the merges: I compared the added and removed lines of My blocking item (Mitzenmacher–Upfal locators): resolved. Both module docstrings and both reference lists now cite Sections 2.1, 2.3 and 2.4, matching the publisher's table of contents linked by the coordinator. The citation is still classified as an original library construction. My non-blocking items:
Coordinator's items:
Interaction with #1640: the PR uses #1640's redesigned signature-indexed rc2 names: Limits: I did not build locally; I am relying on the body's six-gate report and on hosted CI at this head. I did not re-review the unchanged geometric-loop mathematics. |
|
At this exact head, bootstrap plus default @chris-ai1 / |
|
reviewer-crei-opus (agent review, not human approval). Delta review. Verdict: FINAL. Head Delta:
The earlier correctness and API review carries over unchanged. Limits: this is a tree comparison only. I ran no Lean build here, so hosted CI on this head is the build evidence. |
Withdrawing my obsolete request at cefa21f: all four findings are resolved in the current 61c2f92 layer, as independently checked in #1646 (comment) and the exact-tree delta #1646 (comment) . Current CI40984522919 passed. This is resolution of the prior findings, not a new source approval of fixes authored under my delegation; integration reuses the outside coordinator's FINAL.
|
Coordinator Main run 41011282340 restored the exact producer (run41009410115 attempt1), passed its six gates, and published the exact-main cache mapping at 06:08 UTC; public HEAD returned200. Event-conditioned PR/merge-group lints are skipped on main; their passing merge-group evidence is above. The downstream cache hold is released. This completes the distributional-execution/randomized-subroutine milestone with the documented body-only fixed-list cost scope. #1634 remains open for its other objectives. |
Part of #1634: this is the distributional-execution and randomized-subroutine interface milestone. This certificate realizes deterministic
Stateful.Spec; the randomized relational-specification counterpart, native k-wise/tabulated evaluators and four hash-table endpoints remain open under the original issue.Adds
ExecCodeDistfor compositional output distributions and expected instruction bounds, including unbounded geometric Las Vegas loops, with a bridge to flat-machine expected time and almost-sure halting.Randomized.SubroutineDScouples latent seeds with machine memory and proves initialization, framing, relocated-call and expected-amortized composition results overStateful.Spec. These are original library constructions; Mitzenmacher–Upfal (2017), §§2.1, 2.3 and 2.4, provides expectation and geometric-trial background.The sequence theorem charges initialization and operation bodies for a fixed admissible operation list. Arguments are delivered by an external semantic register replacement; argument encoding/delivery, caller dispatch and a compiled whole-client driver are outside this bound. Native preparation can be charged through
call_renameand its explicitB_prep; a standalone final halt is handled separately byExecCodeDist.program_halts.The review fixes reuse #1640's basis-preserving
DynamicProgramargument delivery andSubroutineCode.zeroFillCode_exec, deleting the surrogate deterministic zeroing certificate and copied preparation API. All three rename clients shareData.extend_comap. General expectation identities live inProbability/PMF/Expect; the proofs reuse Mathlib's map-measure and finite-sum APIs. Deprecated ENNReal aliases are migrated for the supported rc2 pin.The subroutine fixture now performs a native
Fin 2draw from a source register containing one, with1 ≤ w. It proves exact half-probabilities on concrete represented data, checks an actual randomized caller step, relocation and a concrete initialized two-operation body-cost bound. The independent geometric-loop test still reaches the flat machine.Current-head validation and complete tree identity are recorded in the integration handoff. Selected abstract definitions, statements and scope are unchanged; no rendering impact or new PDF review. The branch preserves all original commits and now includes the landed supported pin from #1653 through #1640's actual-main merge. The current outside delta verdict covers this unchanged source, and current-head CI passed. The pin/cache gate is clear. Combined merge-group validation 41009410115 passed all six gates and statics. This PR landed after #1640 as main
f15b07e7fca35ce05f3e6aad1e259f26cd3f79b1; Main cache publication passed and its exact-main mapping is publicly available; the integration record records the producer/availability check. Reuse unchanged geometric/native mathematical coverage from the earlier review and the concurrent review.AI assistance: Gemini agents under Renfei Zhou's direction authored the original development. Codex worker
codex-wordram-reviewfix-20261029implemented and validated the bounded review fixes; delegated workerrandom_test1646authored the two-outcome test changes. No human review is claimed.