diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d118f2..557e8b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,48 @@ Machine-checked milestones for `aska-physical/optifab`. +## [0.3.0] - 2026-11-17 + +The proof now covers the plant model and the loop over designs, and two new proposers have used the loop. + +### Added + +- **The plant model in Lean.** `formal/PlantGate.lean` holds the model that turns a design into margins and an + objective, the bounds on each gene, and the step that takes a design up. Seven theorems about designs + (`step_complete`, `step_refusal_changes_nothing`, `loop_safe`, `loop_in_bounds`, `loop_never_worse`, + `loop_bounded`, `loop_keeps_physics`) join the eight about the gate. `lake comparator --paranoid` accepts all + fifteen under six kernels. +- **A whole-run mode in the Lean executable.** A line starting with `l` goes through the proved `loop` and + `changes`. `--formal` runs each of the four ledgers through it in one piece as well as decision by decision, + and `loop.check_continuity` checks that each ledger entry starts from the outcome of the one before. +- **A proposer's command line**, `tools/propose.py`, and `loop.run_proposals`, which replays any recorded list + of proposals. +- **A recorded run by a language model** (`results/model_run.json`, `results/model_ledger.json`): 11 proposals, + 10 taken up, objective 0.919548. Its closing notes are in `results/model_lessons.md`. +- **A second recorded run**, by a model given those notes (`results/model_run_2.json`): the same objective in + 4 proposals. Its notes are in `results/model_lessons_2.md`. +- **An adversarial proposer** (3,006 proposals) and a **first look at a network** (assumption A-4, section 13 + of the model note). +- Must-fail controls 25 to 28. Findings 16 to 19 in the README. + +### Known defects + +An independent read by a separate agent found five defects in the plant model, listed in `formal/SPEC.md` and +in section 11 of the model note. The two that change numbers: the objective is about 18 ppm too high for every +design, and the outage margin leaves out the fixed heat load. They are disclosed and not fixed in this version. +The same read found prose that claimed more than the statements say. That prose is corrected. + +### Changed + +- `loop.py` computes margins and the objective with the exact model in `formal/tests/oracle.py` in place of + floating point. The figures of the seeded run are unchanged. +- The ledger records both designs of every decision. `--formal` replays three ledgers (3,071 decisions) by + giving Lean the designs, so the margins, the objective, the verdict and the budget are all worked out again. +- The step over designs refuses a design outside the bounds (`bounds`) and one that lowers the objective + (`worse`), in addition to the gate's refusals. +- Differential tests: 405,000 inputs (300,000 gate decisions, 100,000 proposed designs and 5,000 whole runs). +- `results/formal.json` holds one hash per ledger. + ## [0.2.0] - 2026-11-17 Status: claimed. Prepared by an AI agent; not reviewed by a person. Nothing is called verified. diff --git a/HANDOFF.md b/HANDOFF.md index e9bc635..fb3fdf2 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -1,8 +1,8 @@ -# Handoff: aska-physical/optifab v0.2.0 +# Handoff: aska-physical/optifab v0.3.0 Written under the group ethos: leave everything the next agent needs so nothing has to be derived twice. -optifab v0.1.0 and v0.2.0 were prepared by an AI agent on 2026-11-17. They are claimed work. No person has +optifab v0.1.0, v0.2.0 and v0.3.0 were prepared by an AI agent on 2026-11-17. They are claimed work. No person has reviewed them. ## 1. What was learned and checked @@ -36,6 +36,18 @@ The fifteen findings are in [README.md](README.md) and derived in [docs/MODEL.md admitted, the objective up from 0.914228 to 0.919009, every decision replayed in Lean. 15. A design that sits exactly on a limit cannot change under this gate, and a proposer with no reserve slows itself. +16. v0.3.0: the plant model, the bounds, the objective and the step are in Lean beside the gate, and seven more + theorems are about designs (fifteen in all). For any proposer the design held stays within the model's + limits and its bounds, its objective never falls, and a margin within the limit is proved to mean three + exact inequalities about heat and storage. +17. A language model proposed through `tools/propose.py`, seeing only the printed state: 11 proposals, 10 + taken up, objective 0.919548, the best a direct search finds (the seeded search reached 89.9% of that + gain). A second instance of the same model, given the first run's notes, got there in 4 proposals. Two runs, not an experiment. + Both end 785 ppm from a limit, where the loop can change nothing more. +18. 3,006 adversarial proposals could not move the design out of its envelope or past its budget. +19. Under assumption A-4 the load floor rises steeply with recooling temperature: 0.564 MW at 30 °C, + 2.804 MW at 38 °C, no self-cooling at 41 °C. Placement between campuses is degenerate in the + current plant model. [docs/VISION.md](docs/VISION.md) sets these against the vision, part by part. @@ -130,11 +142,14 @@ optifab's verifier fails on purpose (must-fail control 1 and the recooling-field ## 4. Artifacts -- [verify.py](verify.py): the derivations, both gates, the plant frame, the loop, the graph and unit checks, 24 - must-fail controls. `--formal` rebuilds the proofs and replays the ledger in Lean. -- [loop.py](loop.py): the improvement loop. [formal/](formal/README.md): the Lean project. +- [verify.py](verify.py): the derivations, both gates, the plant frame, the loop, the graph and unit checks, 27 + must-fail controls. `--formal` rebuilds the proofs and replays three ledgers in Lean. +- [loop.py](loop.py): the improvement loop. [formal/](formal/README.md): the Lean project, which now holds + the plant model. [formal/tests/oracle.py](formal/tests/oracle.py) is its Python copy, and `loop.py` calls it. +- [tools/propose.py](tools/propose.py): the proposer's command line. [results/model_run.json](results/model_run.json) + is the recorded run of a language model and [results/model_ledger.json](results/model_ledger.json) its ledger. - [results/ledger.json](results/ledger.json) and [results/formal.json](results/formal.json): every decision of - the loop, and the record of the last formal run. + the seeded loop, and the record of the last formal run. - [results/certificate.json](results/certificate.json): the outputs `verify.py` must reproduce. - [data/](data/): vendored inputs with hashes, 48 pins, the graph, the unit, and the commit of each of 36 repositories. @@ -160,7 +175,15 @@ Items 1 to 4 close the open places in the loop ([docs/STRUCTURE.md](docs/STRUCTU and L8). To change the formal project: edit `formal/`, then run `python3 verify.py --formal --write`. Any change to a -Lean source, the oracle or the ledger makes must-fail control 24 fail until the formal run is repeated. +Lean source, the oracle or a ledger makes must-fail control 24 fail until the formal run is repeated. A change +to the model has to be made twice, in `formal/PlantGate.lean` and in `formal/tests/oracle.py`. The differential +tests fail if the two differ. After a change, commit, then rerun the bar check, because it compares the test +record with the committed one. + +A recorded run is never edited. To make another, use a new file with `tools/propose.py NEW.json new` +and add it to `RECORDED_RUNS` in `verify.py`. The wording of the rules that `show` prints was changed after +the two recorded runs, from what the proposers found unclear. A third run would see the new wording and +could be given `results/model_lessons_2.md`. 1. **Agree the plant frame with Weft (interface L2, element W1).** The 16 slots are defined and tested here. Weft's owners decide whether the frame shares their telemetry bus or travels as an abios line. Done when one @@ -184,9 +207,10 @@ Lean source, the oracle or the ledger makes must-fail control 24 fail until the today, so no project can yet pass bar item 1. 8. **A second verifier that shares no code (optifab).** The Foundation-0 physics rule asks for two. A different agent, or a different language, should recompute sections 1 to 5 of the model note from the same pins. -9. **A network of campuses (optifab).** v0.1.0 models one. With N campuses, each with a load floor, a thermal - budget and a margin radius, placing work becomes an optimisation: most compute per unit of utility energy, - subject to every gate. State that problem and solve a small case exactly. +9. **A network of campuses (optifab).** v0.3.0 has a first look (section 13 of the model note). The placement + problem is degenerate in the current plant model, because utility power has the same slope at every site. + Before solving anything, give the model a cost that differs by site, or a decision to switch a campus off. + See the status note under proposal 8. 10. **Replicate the top of the stack (Foundation-0, aska-physical).** incentre-lattices' results sit under 6 repositories of the stack and nhanes-bioimpedance under 5. An independent replication there lifts the most work. See the evidence table in [docs/CONVERGENCE.md](docs/CONVERGENCE.md). @@ -204,7 +228,13 @@ Lean source, the oracle or the ledger makes must-fail control 24 fail until the - **Whether the plant gate is a direction worth pursuing.** Its arithmetic is now proved, and it has been run on a model. It has never seen a sensor or a machine. - **Who reviews `formal/SPEC.md`.** Until a person who did not write it approves it, nothing here may be - called verified. + called verified. The specification grew in v0.3.0 (the model and seven statements), so its hash changed. +- **The five known defects in the model** (`formal/SPEC.md`). Fixing the objective and the outage margin changes + every published objective figure and the ledgers of the two recorded runs. The owner should say whether to fix + and re-run, or fix and keep the runs with a note. +- **A branch rule.** Bar item 7 is open in CI: `main` does not require the `bar / bar` check. Only a repository + admin can add that rule. +- **Assumption A-4.** The site-dependence of the load floor rests on it. A chiller datasheet would replace it. - **Sign-off.** Nothing here counts until a named person reviews it. ## 7. How this session worked diff --git a/README.md b/README.md index f14f89c..0b42cae 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Modelling the ideal datacenter. -**Status: v0.2.0, claimed.** An AI agent wrote this version and no person has reviewed it. Nothing in it is +**Status: v0.3.0, claimed.** An AI agent wrote this version and no person has reviewed it. Nothing in it is measured. Every number is derived from the certificates of other repositories, which are themselves models. optifab is the design of one physical structure that holds the work of four organisations, so that the digital @@ -26,7 +26,7 @@ that improves its own hardware and software, part by part. The work it joins: The reference campus is funi-frame's: 10 MW of IT load on a 2,500 m² plan, two storeys. -## What v0.1.0 finds +## What it finds Each line is derived in [docs/MODEL.md](docs/MODEL.md) and recomputed by `verify.py`. Labels follow the Foundation-0 standard: PROVEN (written proof, checked symbolically), VERIFIED (finite check). @@ -45,9 +45,13 @@ Foundation-0 standard: PROVEN (written proof, checked symbolically), VERIFIED (f | 10 | **The contract fits in one 64-byte frame.** The 12 margins, the budget, the load, the recooling temperature and the time fill the 16 floats of the frame Weft already uses for telemetry. The design point as certified cannot fill the recooling slot. | VERIFIED. The slot meanings are a proposal. | | 11 | **The Terrafab latency figures hold in direction, and this campus does not need them.** A 15 ms loop can counter none of the four plant vibration tones within its cycle; a 0.5 ms loop can counter all four. Passive isolation already holds rack vibration at 17.9% of its limit, and every term of the contract moves over seconds to minutes. | PROVEN (identity), VERIFIED | | 12 | **Every repository has a place, and the loop is open.** 32 of 41 repositories are placed in the structure and 9 are listed as having no place. Of the 10 interfaces that would close the loop between structure and intelligence, 4 are checked. | VERIFIED (the accounting). Statuses were assigned here. | -| 13 | **The gate and the loop built on it are proved in Lean.** Eight theorems about an exact integer gate, accepted by `lake comparator --paranoid` under six kernels. Whatever is proposed, no margin passes its limit and the budget is never overdrawn; the number of changes is at most the budget a person set. The Proven Commons bar check passes items 2 to 6. It is not verified: no reviewer has approved the specification. | Machine-checked proof. Bar item 1 open. | -| 14 | **Hardware and software improve together under that gate.** A loop proposed 50 changes to three hardware and two software parameters. 45 were admitted (30 hardware, 15 software) and 5 refused. The objective rose from 0.914228 to 0.919009 and never fell, and every decision was replayed in Lean with no mismatch. It runs on a model: no sensor, load or machine is involved. | VERIFIED on a model. The scenario is a choice, so the figures are illustrations. | +| 13 | **The gate and the loop over designs are proved in Lean, with the plant model inside the proved code.** Fifteen theorems, accepted by `lake comparator --paranoid` under six kernels. Eight are about an exact integer gate. Seven are about designs, with the three moving margins and the objective computed inside the proved code. From a start within its limits and bounds, whatever designs are proposed, the design held stays within every modelled limit and within its bounds, its objective never falls, and the number of changes is at most the budget a person set. The model itself is defined, not proved, and an independent read found five defects in it, listed in [formal/SPEC.md](formal/SPEC.md). The Proven Commons bar check passes items 2 to 6. It is not verified: no reviewer has approved the specification. | Machine-checked proof. Bar item 1 open. | +| 14 | **Hardware and software improve together under that gate.** A loop proposed 50 changes to three hardware and two software parameters. 45 were admitted (30 hardware, 15 software) and 5 refused. The objective rose from 0.914228 to 0.919009 and never fell, and every decision was worked out again in Lean from the two designs with no mismatch. It runs on a model: no sensor, load or machine is involved. | VERIFIED on a model. The scenario is a choice, so the figures are illustrations. | | 15 | **A design that sits exactly on a limit cannot change.** Started with one margin at its limit, the loop admitted nothing. A proposer with no reserve had 126 of 186 proposals refused and finished lower. Headroom is what makes change possible. | VERIFIED on a model | +| 16 | **A margin within its limit means a physical inequality, with no rounding in it.** Proved for every design the loop can reach from a start within its limits: the captured heat can drive the cooling needed at full load, the plant cools itself at the scheduler's load floor, and the store holds the IT heat of one outage. The first follows from the second for any floor up to the IT load, so these are two independent facts, not three. This is a statement about the model. Its constants are claimed, not measured. | Machine-checked proof about a model | +| 17 | **A language model has proposed through the same interface, and a second run built on the first one's notes.** Given only the loop's printed state, the first made 11 proposals in a limit of 40. 10 were taken up, 4 of them changing hardware and software in one step. The objective reached 0.919548, the best a direct search finds possible. The seeded search reached 0.919009 (89.9% of that gain) with 50 proposals. A second instance of the same model, with no memory of the first run, was given the notes the first left. It reached the same 0.919548 in 4 proposals with 0 refused. The proposals, reasons and notes are in [results/](results/), and both ledgers replay in Lean. | VERIFIED (the replays). Two runs are anecdotes, not an experiment. | +| 18 | **An adversary cannot move the design out of its envelope.** 3,006 proposals built to break the loop: genes out of bounds, margins past limits, designs that score lower, then random ones. 64 were taken up, which is the whole budget, and no more. Every design held stayed within every limit and every bound, and the objective never fell. | VERIFIED on the Python copy. The property itself is proved in Lean. | +| 19 | **A campus's load floor is a property of its site.** If the chiller keeps its design share of the reversible COP, the floor is 0.564 MW with recooling at 30 °C, 2.804 MW at 38 °C and 6.113 MW at 40 °C. At 41 °C the campus cannot cool itself at any load, though 41 °C is under the limit of finding 2. One cool and one warm campus cannot idle below 3.368 MW, 16.8% of their nameplate. In the plant model, moving load between campuses changes no energy, so a placement optimum needs a model with a site-dependent cost first. | VERIFIED under assumption A-4 | Findings 1 and 2 concern funi-frame and are written up for its maintainers in [HANDOFF.md](HANDOFF.md). @@ -74,9 +78,9 @@ pip install sympy python3 verify.py ``` -This recomputes every figure from the pinned inputs, runs the improvement loop, runs 24 must-fail controls, and -compares the result with [results/certificate.json](results/certificate.json) and -[results/ledger.json](results/ledger.json). It reads no network and needs no Lean. It checks that the committed +This recomputes every figure from the pinned inputs, runs the improvement loop, replays the recorded runs, runs 28 must-fail controls, and +compares the result with [results/certificate.json](results/certificate.json) and the two ledgers in +[results/](results/). It reads no network and needs no Lean. It checks that the committed formal record matches the current Lean sources and ledger. To rebuild the proofs and replay the ledger in Lean (needs Linux, [elan](https://github.com/leanprover/elan) @@ -84,8 +88,15 @@ and bubblewrap): ```bash python3 verify.py --formal -# [FORMAL] comparator accepts 8 theorems under 6 kernels; 300000 differential tests, 0 failures; -# ledger replay 50 decisions, 0 mismatches +# [FORMAL] comparator accepts 15 theorems under 6 kernels; 405000 differential tests, 0 failures; +# ledger replay 3071 decisions, 0 mismatches +``` + +To propose a design yourself, or to let a model do it: + +```bash +python3 tools/propose.py my_run.json new +python3 tools/propose.py my_run.json try pcm_kwh=2700 shed_ppm=250000 --why "more store, so shed less" ``` To re-read every cited line from the source repositories: @@ -104,17 +115,26 @@ python3 verify.py --upstream ../upstream - Anything about more than one campus. A network of campuses is the next step, not this one. - That the gate is safe to put in control of a plant. Its arithmetic is proved. The margins it is fed are not, and it can only refuse a step. Nothing here commands anything. -- That the loop's gains are real. Its plant model, objective and scenario are unproved choices. +- That the loop's gains are real. The loop is proved to keep its model within the model's limits. The model's + constants, the objective and the scenario are choices, and none is measured. The objective has a known + error of about 18 ppm that is the same for every design ([formal/SPEC.md](formal/SPEC.md), known defects). +- That a language model is a good proposer, or that notes always help the next one. Two recorded runs show + the interface and the hand-over work. They measure nothing. - Anything the Terrafab documents claim. They are the source of the idea and are not used as evidence. ## Layout ``` -verify.py the verifier: derivations, the gates, the frame, the loop, graph and unit checks, 24 must-fail controls -loop.py the improvement loop: genome, plant model, proposer, ledger -formal/ the exact gate and the loop, proved in Lean, in the Proven Commons layout +verify.py the verifier: derivations, the gates, the frame, the loop, graph and unit checks, 28 must-fail controls +loop.py the improvement loop: the seeded proposer, the replay of recorded proposals, the ledger +formal/ the exact gate, the plant model and the loop, proved in Lean, in the Proven Commons layout results/certificate.json what verify.py must reproduce results/ledger.json every decision of the loop, hash-chained +results/model_run.json the proposals a language model made through the interface, each with its reason +results/model_ledger.json the decisions on them, hash-chained +results/model_lessons.md the notes that proposer left, word for word +results/model_run_2.json a second run, by an instance that was given those notes; model_ledger_2.json and + model_lessons_2.md are its ledger and its own notes results/formal.json the record of the last formal run: comparator, differential tests, Lean replay data/upstream/ byte-exact copies of three certificates, Weft's vectors and Weft's gate (the test oracle) data/pins.json every literal and line read from another repository @@ -122,11 +142,11 @@ data/graph.json the cross-organisation map: repositories, links, citat data/unit.json the structure: each element, where it sits, whose work it rests on, and its status data/sources.json pinned commit and file hashes for each repository docs/VISION.md how close this is to the vision, part by part -docs/PROPOSALS.md eight systems proposed for the open gaps +docs/PROPOSALS.md eight systems proposed for the open gaps, and how far each has got docs/STRUCTURE.md one structure: the unit, the loop, the plant frame, and the Terrafab claims one by one docs/MODEL.md each result, its derivation and its assumptions docs/CONVERGENCE.md the map as tables, generated from data/graph.json -tools/ fetch_upstream.py and render_map.py +tools/ propose.py (the proposer's command line), fetch_upstream.py and render_map.py HANDOFF.md what was learned, what failed, and what to do next ``` diff --git a/data/unit.json b/data/unit.json index 057ba48..db65f45 100644 --- a/data/unit.json +++ b/data/unit.json @@ -220,14 +220,14 @@ { "id": "R2", "organ": "Reflex", - "element": "A machine-checked proof of the gate and of the loop built on it", + "element": "A machine-checked proof of the gate, the plant model and the loop", "where": "with the gate", "repos": [ "aska-physical/optifab", "Proven-Commons/mission" ], "status": "checked", - "note": "formal/ proves eight theorems in Lean about an exact integer gate. The comparator accepts them under six kernels and Proven Commons bar items 2 to 6 pass. Item 1 is open: no reviewer has approved the specification, so it is not verified. Weft's own floating-point gate has no proof yet." + "note": "formal/ proves fifteen theorems in Lean: eight about an exact integer gate, seven about the loop over designs, with the plant model inside the proved code. The comparator accepts them under six kernels and Proven Commons bar items 2 to 6 pass. Item 1 is open: no reviewer has approved the specification, so it is not verified. Weft's own floating-point gate has no proof yet." }, { "id": "R3", @@ -238,7 +238,7 @@ "aska-physical/optifab" ], "status": "checked", - "note": "Runs on a model of the plant. Every decision is made by the exact gate, recorded in a hash-chained ledger and replayed in Lean. No sensor, load or machine is involved." + "note": "Runs on a model of the plant that is itself inside the proved code. Every decision is recorded in a hash-chained ledger and worked out again in Lean from the two designs. A seeded search, a language model and an adversary have each proposed through it. No sensor, load or machine is involved." }, { "id": "M1", @@ -435,7 +435,7 @@ "from": "proposer", "to": "gate and ledger", "status": "checked", - "note": "The improvement loop: each proposed change to hardware or software is decided by the exact gate, logged and replayed in Lean. On a model only." + "note": "The improvement loop: each proposed design is checked against its bounds, the exact gate and the objective, logged, and replayed in Lean. A language model has proposed through it once. On a model only." } ], "interface_statuses": [ diff --git a/docs/MODEL.md b/docs/MODEL.md index ed3c2fc..8addb6a 100644 --- a/docs/MODEL.md +++ b/docs/MODEL.md @@ -332,9 +332,52 @@ margins in parts per million of their limit, and proves eight theorems about it. the limit and the budget is not negative. - `run_bounded`: the number of admitted changes plus the budget left never exceeds the budget at the start. -`lake comparator --paranoid` accepts all eight under six kernels with the standard axioms only. A Python copy -of the gate agrees with the Lean executable on 300,000 generated inputs. The Proven Commons bar check reports -items 2 to 6 as passing ([formal/BAR-REPORT.md](../formal/BAR-REPORT.md)). +Those eight take the margins as given. Since v0.3.0 the plant model of section 12 is in the same Lean file, +as exact integer arithmetic, with the bounds on each gene, the objective and the step that takes a design up. +Seven more theorems are about designs. In them the three margins that move with the genes are computed +inside the proved code. The eleven carried as constants are still inputs. + +- `step_complete`: with budget left and the design held within the limit, a design within the bounds and the + headroom that does not lower the objective is taken up. +- `step_refusal_changes_nothing`: a design that is not taken up leaves the design held and the budget as + they were. +- `loop_safe`, `loop_in_bounds`, `loop_bounded`: from a start within the limit and the bounds, after any list + of proposed designs, the margins of the design held are within the limit, its genes are within their bounds, + and the changes are within the budget. +- `loop_never_worse`: after any list of proposed designs, the objective is at least what it was at the start. + It may be equal. +- `loop_keeps_physics`: with the limit at 1,000,000 ppm and a start within it, the design held satisfies + three exact inequalities. The cooling needed at full load is at most what the captured heat can drive. The + fixed heat load is at most the cooling gained at the scheduler's floor. The IT heat of one outage is at most + what the store holds. Rounding plays no part in them. The first follows from the second for any scheduler + floor up to the IT load. + +`lake comparator --paranoid` accepts all fifteen under six kernels with the standard axioms only. A Python +copy of the gate, the model and the step agrees with the Lean executable on 405,000 generated inputs: 300,000 +gate decisions, 100,000 proposed designs and 5,000 whole runs through the Lean `loop`. The Proven Commons bar check reports items 2 to 6 as passing +([formal/BAR-REPORT.md](../formal/BAR-REPORT.md)). + +What the seven do not say: that the model describes a real plant, or that it is free of mistakes. Its +constants are pinned from certificates that are claimed and not measured, eleven of its fourteen margins are +carried as constants, and the bounds and the scenario are declared by a person. + +**Known defects.** A separate agent read the new statements against this prose and the earlier floating-point +model. It confirmed the units and that the integer model matches the floating-point one. It also found five +defects, each checked here by running the numbers, and listed in [formal/SPEC.md](../formal/SPEC.md): + +1. The objective subtracts the whole utility power of the shed load in an outage, including the part that + does not depend on load. Every objective in this note is about 18 ppm too high. The corrected start is + 0.914210 (published 0.914228) and the corrected end of the seeded run is 0.918990 (published 0.919009). + The order of designs does not change, except between designs that tie. +2. The outage margin counts IT heat and leaves out the fixed heat load, about 71 kWh in a 20-minute outage. +3. A design that scores the same is taken up and charged, even one identical to the design held. 30 of the + 45 changes in the seeded run left the objective unchanged. So "never worse" is what is proved, and a + proposer can spend the budget without improving anything. +4. Nothing requires the plant, the bounds or the start to make sense. +5. A large move towards safety is refused as too far, and a start past a limit can never be repaired. + +They are not fixed in this version. A fix to 1 or 2 changes every objective and margin figure and the +ledgers of the recorded runs, whose notes quote the present figures. In the loop the radius is the headroom of the baseline: the smallest distance from any margin to its limit. Section 5's lemma, that a move within the headroom passes no limit, is one of the eight @@ -342,8 +385,9 @@ Section 5's lemma, that a move within the headroom passes no limit, is one of th ## 12. The improvement loop -**VERIFIED** on a model (deterministic, replayed in Lean). The plant model, the objective and the scenario are -choices made in `loop.py`. The figures illustrate the mechanism and predict nothing. +**VERIFIED** on a model (deterministic, replayed in Lean). Its safety, its bound and the fact that it never +gets worse are **machine-checked** (section 11). The plant model, the objective and the scenario are choices. +The figures illustrate the mechanism and predict nothing. A genome holds three hardware genes (thermal store in kWh_th, liquid capture fraction, wall U-value), two software genes (the scheduler's load floor, the share of load shed in a cooling outage) and the proposer's own @@ -354,8 +398,9 @@ outages of 20 minutes and 2,000 hours at 3% demand. Each generation the proposer tries six single-gene changes. On even generations they are software changes, scored by the objective. On odd generations they are hardware changes, scored by the headroom they open. The -best goes to the exact gate with a cost of one unit against a budget of 64. An admitted candidate becomes the -baseline. The step scale doubles after an admission and halves after a refusal. +best goes to the step function with a cost of one unit against a budget of 64. The step takes it up if it is +within the bounds, passes the exact gate and does not lower the objective. A design that is taken up becomes +the one held. The step scale doubles after an admission and halves after a refusal. | | Run | Proposer with no reserve | Budget of 3 | Start on a limit | |---|---|---|---|---| @@ -366,11 +411,72 @@ baseline. The step scale doubles after an admission and halves after a refusal. The start is 0.914228, except in the last column, which starts at 0.914230 and does not move. The run ended with budget to spare because every hardware gene had reached the edge of -its search range. `python3 verify.py --formal` replays all 50 decisions through the Lean executable: no -mismatch. The floating-point gate of section 6 gives the same verdict on all 50. +its search range. The ledger records both designs of every decision. `python3 verify.py --formal` gives the +two designs to the Lean executable, which works out the margins, the objective, the verdict and the budget +again: no mismatch on any of the 50. The floating-point gate of section 6 gives the same verdict on all 50. + +Two other proposers have used the same step function. + +**A recorded run by a language model.** `tools/propose.py` prints the design held, its margins, the radius, +the objective and the budget, and takes a proposal for one or more genes with a sentence of reasons. A +language model was given that output and nothing else, with a limit of 40 proposals. It made 11. 10 +were taken up (4 hardware, 2 software, 4 changing both at once) and the rest were refused +(1 as `worse`). The objective went from 0.914228 to 0.919548. A direct search over the software genes, with the +hardware genes at their most generous bounds, finds 0.919548 to be the best any design within the limits can +score, so the run reached 100.0% of the possible gain. The seeded search reached 89.9%. The proposals +and the reasons are in `results/model_run.json`. `verify.py` replays them and must reproduce +`results/model_ledger.json`. + +**A second run, given the first one's notes.** The first run's closing notes were saved word for word in +`results/model_lessons.md`: three fitted formulas for the moving margins, the gain per kW of floor, and what +its one refusal taught it. A second instance of the same model, with no memory of the first run, was given those notes and the same +interface. It made 4 proposals and all 4 were taken up, 3 of them changing hardware and software +together. It reached 0.919548, the same design in the two software genes. The first run needed 11 +proposals to reach that objective and the second 4. Its own notes are in `results/model_lessons_2.md`. + +These are two runs of one model. They show that the interface is enough to work from and that notes +can be handed on. They do not measure how good a proposer a model is. Both runs end with the load-floor +margin at 999,215 ppm, 785 from its limit: the objective rewards a lower floor and nothing +rewards headroom, so a good proposer drives the design to where it can no longer change. + +**An adversary.** `adversary_run` makes 3,006 proposals meant to break the loop: a capture fraction of 200%, +a negative store, a scheduler floor of zero and one below the plant's floor, a design that scores lower, then +random designs, half of them anywhere in or just outside the bounds and half near the start. The verdicts were +55 `bounds`, 1604 `budget`, 1278 `distance`, 64 `ok`, 5 `worse`. The budget of 64 was spent and not one change more was made. Every design held stayed within every +limit and bound and the objective never fell. The theorems of section 11 say this must be so for the Lean +code. This run checks it on the Python copy, and `--formal` replays all of it in Lean. [VISION.md](VISION.md) discusses what the loop shows and how far it is from the system it stands in for. +## 13. A first look at a network: the load floor depends on the site + +**VERIFIED** under assumption A-4. A-4, made here: at any recooling temperature the sorption chiller reaches +the same share of its reversible COP as at the design point. With 58 °C drive, 18 °C chilled water and 30 °C +recooling the reversible COP is 2.051, so the claimed 0.62 is a share of 0.302. The 30 °C is the design value +proposed in aska-physical/funi-frame#4. No certificate states one. + +Section 3 gave the load floor as `q_fix / ((1 + COP) α − 1)`. Under A-4 the COP falls as the recooling +temperature rises, and the floor rises with it: + +| Recooling | Sorption COP | Load floor | Share of nameplate | +|---|---|---|---| +| 30 °C | 0.620 | 0.564 MW | 5.6% | +| 34 °C | 0.399 | 1.127 MW | 11.3% | +| 36 °C | 0.325 | 1.687 MW | 16.9% | +| 38 °C | 0.266 | 2.804 MW | 28.0% | +| 40 °C | 0.217 | 6.113 MW | 61.1% | +| 41 °C | 0.196 | none: it cannot cool itself at any load | | + +So the 41.5 °C of section 2 is a limit of principle and not a working limit. Well below it the campus has to +run most of its nameplate just to cool itself. + +For a network this gives two results. A cool campus and a warm one (30 °C and 38 °C) cannot idle below +3.368 MW together, 16.8% of their nameplate, and the warm one's floor is 4.97 times the cool +one's. And in the upstream plant model utility power is a straight line in IT load whose slope, 1.0357 MW +per MW, does not depend on the site. Moving load from one campus to the other therefore changes no energy. +The placement problem of proposal 8 has no single optimum in this model: any split that keeps both campuses +above their floors uses the same energy. A useful network model needs a cost that differs by site first. + ## Limits - No measurement of any kind. Every input is the output of another model. diff --git a/docs/PROPOSALS.md b/docs/PROPOSALS.md index b564a50..8505289 100644 --- a/docs/PROPOSALS.md +++ b/docs/PROPOSALS.md @@ -66,6 +66,14 @@ run is compared with the seeded search on the same budget. A second slice lets a **Rests on.** `loop.py`, abios for the message format, the model's API. **Boundary:** the model proposes and the gate decides. Nothing here gives a model authority to act. +**Status, v0.3.0.** The interface exists (`tools/propose.py`) and the first slice is done twice. A language +model made 11 proposals, 10 were taken up, and the ledger replays in Lean +([results/model_run.json](../results/model_run.json)). A second instance of the same model, given the first run's notes +([results/model_lessons.md](../results/model_lessons.md)), reached the same objective in 4. Open: many runs +with a stated protocol, so that a comparison means something; a Weft cell or an Exo agent as the proposer; +a format for the notes that a program can check; and an objective that does not drive the design onto a +limit, where it can no longer change. + ## 4. Structural genes **The gap.** The loop changes three thermal parameters. The eleven certified structural margins are constants @@ -143,3 +151,11 @@ optimum breaks a load floor. **Rests on.** The contract in this repository. funi-frame's open issue on dispatch against negative prices is the natural second slice. + +**Status, v0.3.0.** A first look is in the certificate (`network_first_look`, section 13 of the model note). +It changes the first slice. In the upstream plant model utility power is a straight line in IT load with the +same slope at every site (1.0357 MW per MW), so moving load between campuses changes no energy and the +linear programme has no single optimum. What does differ by site is the load floor: 0.564 MW at 30 °C +recooling and 2.804 MW at 38 °C, if the chiller keeps its design share of the reversible COP. So the +first slice should be one of: a loop COP that depends on the site, a choice to switch a campus off (which +no certificate covers), or a cost for moving work. The owners should pick. diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md index 3fc17d1..cad4a14 100644 --- a/docs/STRUCTURE.md +++ b/docs/STRUCTURE.md @@ -82,8 +82,8 @@ structure, where it sits, and whose work it rests on. | | Element | Where in the structure | Work it rests on | Status | Note | |---|---|---|---|---|---| | R1 | The gate | at each controller and in the scheduler | [weft](https://github.com/Moissanite-Labs/weft), [weft-corpus](https://github.com/Moissanite-Labs/weft-corpus) | checked | Weft's predicate, first written in the Terrafab documents as a fence for machines. It passes Weft's 15 vectors and runs here on plant numbers. | -| R2 | A machine-checked proof of the gate and of the loop built on it | with the gate | [optifab](https://github.com/aska-physical/optifab), [mission](https://github.com/Proven-Commons/mission) | checked | formal/ proves eight theorems in Lean about an exact integer gate. The comparator accepts them under six kernels and Proven Commons bar items 2 to 6 pass. Item 1 is open: no reviewer has approved the specification, so it is not verified. Weft's own floating-point gate has no proof yet. | -| R3 | The loop that changes hardware and software together | design office and scheduler | [optifab](https://github.com/aska-physical/optifab) | checked | Runs on a model of the plant. Every decision is made by the exact gate, recorded in a hash-chained ledger and replayed in Lean. No sensor, load or machine is involved. | +| R2 | A machine-checked proof of the gate, the plant model and the loop | with the gate | [optifab](https://github.com/aska-physical/optifab), [mission](https://github.com/Proven-Commons/mission) | checked | formal/ proves fifteen theorems in Lean: eight about an exact integer gate, seven about the loop over designs, with the plant model inside the proved code. The comparator accepts them under six kernels and Proven Commons bar items 2 to 6 pass. Item 1 is open: no reviewer has approved the specification, so it is not verified. Weft's own floating-point gate has no proof yet. | +| R3 | The loop that changes hardware and software together | design office and scheduler | [optifab](https://github.com/aska-physical/optifab) | checked | Runs on a model of the plant that is itself inside the proved code. Every decision is recorded in a hash-chained ledger and worked out again in Lean from the two designs. A seeded search, a language model and an adversary have each proposed through it. No sensor, load or machine is involved. | ### Mind @@ -142,7 +142,7 @@ and the loads move the structure's margins, which are sensed again. | L7 | stores and structure | margins | checked | The margin vector from the certificates. It is static: no transient is modelled. | | L8 | gate | fabrication machines | idea | In the Terrafab documents only. | | L9 | every step | the record | designed | Certificates and pins are checked. Signed records are not connected. | -| L10 | proposer | gate and ledger | checked | The improvement loop: each proposed change to hardware or software is decided by the exact gate, logged and replayed in Lean. On a model only. | +| L10 | proposer | gate and ledger | checked | The improvement loop: each proposed design is checked against its bounds, the exact gate and the objective, logged, and replayed in Lean. A language model has proposed through it once. On a model only. | ## How far it is diff --git a/docs/VISION.md b/docs/VISION.md index b2eb20d..1a88897 100644 --- a/docs/VISION.md +++ b/docs/VISION.md @@ -11,22 +11,29 @@ for anything. | Part of the vision | What exists | What is missing | |---|---|---| -| **Formally verified** | Eight theorems about the gate and the loop built on it, proved in Lean with no dependencies ([formal/](../formal/README.md)). `lake comparator --paranoid` accepts them under six kernels with the standard axioms only. The Proven Commons bar check passes items 2 to 6. | A reviewer's approval of the specification, which is bar item 1 and cannot happen yet because the Proven Commons reviewer list is empty. Proofs about anything but the gate: the plant model, the margins, the proposer and the Python are unproved. | -| **End to end** | One command re-runs a chain from pinned certificates to margins, to the gate, to a ledger, to a replay of every ledger decision in Lean (50 decisions, 0 mismatches). | Both ends. No sensor feeds the chain and no valve, load or machine obeys it. Four of the ten interfaces in [STRUCTURE.md](STRUCTURE.md) are checked. | -| **Recursively improving** | A loop ([loop.py](../loop.py)) in which each admitted change becomes the baseline of the next generation. The proposer's own step scale is part of the genome: it doubles after a success, halves after a refusal, and is recorded. 45 of 50 proposals were admitted and the objective rose from 0.914228 to 0.919009 without ever falling. | The proposer is a seeded search, not an intelligence. It tunes one number about itself. It does not learn, and it does not improve the gate, the model or its own code. | -| **Intelligence system** | Weft's adaptive models and Exo's agents have a place in the structure, and the floating-point gate here agrees with Weft's own on 100,000 generated cases. | No model runs in the loop. Neither Weft nor Exo proposes anything, and neither can yet shed load or report the energy it uses. | +| **Formally verified** | Fifteen theorems, proved in Lean with no dependencies ([formal/](../formal/README.md)). Eight are about the gate. Seven are about designs: the plant model, the bounds, the objective and the step are inside the proved code, so the three margins that move are no longer handed to the gate from outside. `lake comparator --paranoid` accepts them under six kernels with the standard axioms only. The Proven Commons bar check passes items 2 to 6. | A reviewer's approval of the specification, which is bar item 1 and cannot happen yet because the Proven Commons reviewer list is empty. Any proof that the model describes the plant: its constants are claimed, eleven of its fourteen margins are carried as constants, and an independent read found five defects in it ([formal/SPEC.md](../formal/SPEC.md)). The proposers and the floating-point gate are unproved. | +| **End to end** | One command re-runs a chain from pinned certificates to a design, to margins and an objective, to the step, to a ledger. A second works every recorded decision out again in Lean from the two designs (3,071 decisions across three ledgers, 0 mismatches). | Both ends. No sensor feeds the chain and no valve, load or machine obeys it. Four of the ten interfaces in [STRUCTURE.md](STRUCTURE.md) are checked. | +| **Recursively improving** | A loop ([loop.py](../loop.py)) in which each admitted change becomes the baseline of the next generation. The proposer's own step scale is part of the genome: it doubles after a success, halves after a refusal, and is recorded. 45 of 50 proposals were admitted and the objective rose from 0.914228 to 0.919009. That it can never fall is now a theorem (`loop_never_worse`), for any proposer. And what one proposer learned has been handed to the next: a second instance given the first run's notes reached the same objective in 4 proposals where the first took 11. | The hand-over was done once, by hand, with notes written in prose. Nothing improves the gate, the plant model or the proposer's own code. The objective is a choice. | +| **Intelligence system** | A language model has proposed through the loop's interface in two separate runs, seeing only the printed state. The first made 11 proposals, 10 taken up, and reached 0.919548 against 0.919009 for the seeded search. The second, given the first one's notes, reached it in 4. Their reasons are recorded with their proposals. Weft's adaptive models and Exo's agents have a place in the structure, and the floating-point gate here agrees with Weft's own on 100,000 generated cases. | These are two recorded runs of one model. Neither Weft nor Exo proposes anything, and neither can yet shed load or report the energy it uses. | | **Evolving hardware and software** | One genome with three hardware genes (thermal store, liquid capture, wall U-value) and two software genes (scheduler load floor, load shed in an outage), under one gate and in one ledger. 30 hardware and 15 software changes were admitted. Hardware changes open headroom and software changes use it. | The hardware is three numbers in a thermal model. The eleven certified structural margins are constants, because the verifiers that compute them were not run with changed inputs. Nothing is built. | | **Cohesive and unified** | One predicate for weights and plant, one 64-byte frame, one margin vector, one record. 32 of 41 repositories from four organisations have a place in one structure. | The organisations share no interface in code yet. Weft does not know the plant frame, Synmerit does not sign the ledger, and no Proven Commons parser is on the telemetry path. | ## What the proofs cover ``` -proved in Lean gate, generation step, loop over any proposals formal/PlantGate.lean -tested against it Python exact gate (300,000 cases), ledger replay formal/tests/, results/formal.json +proved in Lean gate, plant model, bounds, objective, step, formal/PlantGate.lean + loop over any proposed designs +tested against it Python gate, model and step (405,000 cases), formal/tests/, results/formal.json + replay of four ledgers, decision by decision and + as whole runs through the Lean loop tested, not proved floating-point gate against Weft's (100,000 cases) verify.py -computed, not proved margins, load floor, thermal budget, objective verify.py, loop.py -taken on trust the three upstream certificates data/upstream/ -absent sensors, load control, machines, a model that proposes +computed, not proved the plant envelope, the eleven constant margins, verify.py + the site-dependent load floor +recorded, not proved what a language model proposed in two runs, why, results/model_run*.json, + and the notes one run left for the next results/model_lessons*.md +taken on trust the three upstream certificates, the bounds, data/upstream/, loop.py + the scenario +absent sensors, load control, machines ``` The two theorems that matter most for a system that changes itself: @@ -37,9 +44,22 @@ The two theorems that matter most for a system that changes itself: - **`run_bounded`**: the number of changes the loop admits, plus the budget left, never exceeds the budget at the start. Whoever sets the budget sets the most changes the system can ever make to itself. -Both are about the gate's arithmetic. They say nothing about whether the margins fed to the gate are true. -That is the real gap between a proved gate and a safe plant, and it is why the margins need sensors and -independent verifiers behind them. +Both are about the gate's arithmetic, and take the margins as given. Three more are about designs, with the +margins computed inside the proved code: + +- **`loop_safe`**: from a start within the limit, after any list of proposed designs, the margins of the + design held are within the limit. +- **`loop_never_worse`**: after any list of proposed designs, the objective is at least what it was. No + proposer, however bad, can make the design held score lower. It can stay the same: a design that ties is + taken up, so this is "never worse" and not "always better". +- **`loop_keeps_physics`**: what "within the limit" means, as exact inequalities about heat and storage. + +They close the gap between the model and the gate. They do not close the gap between the model and the +plant. Whether the model's constants are true is a question for sensors and independent verifiers. And the +model has mistakes of its own: a separate agent, given the code and not these conclusions, found that the +objective is off by a constant, that the outage margin leaves out the fixed heat load, and that a proposer +can spend the whole budget on designs that tie. They are listed in [formal/SPEC.md](../formal/SPEC.md) and +are not yet fixed, because fixing them changes every published figure and the recorded runs. ## What running the loop showed @@ -59,6 +79,23 @@ These come from the certificate (`improvement_loop`) and can be re-run. The scen 4. **The most tempting change is the one the gate refuses.** Dropping the scheduler's floor below the plant's load floor raises the objective by 0.25% in one step. It puts a margin at 113% of its limit and is refused. 5. **The loop stops where a person told it to.** With a budget of 3 it made exactly 3 changes. +6. **A model proposes differently from a search.** Shown only the printed state, a language model made 11 + proposals and 10 were taken up, 4 of them moving hardware and software in the same step. It reached + 0.919548, which a direct search finds to be the best any design within the limits can score. The seeded + search reached 89.9% of that gain with 50 proposals. The model first probed each gene, then + fitted a formula to each margin, then planned its moves with the formulas. Its reasons are recorded. +7. **What one proposer learned, the next could use.** The first run's closing notes, word for word, were + given to a second instance of the same model with no memory of that run. It reached the same objective in 4 proposals, all taken + up, where the first had needed 11 with 1 refused. It then wrote its own notes, which correct and add + to the first set. That is the smallest version of a system improving its own improver, and it was done by + hand, once. +8. **A good proposer ends where it cannot move.** Both runs drove the load-floor margin to 999,215 ppm, + which leaves a radius of 785. The objective may not fall, so the design cannot back away from + the limit either. A loop that is proved safe and proved never to get worse comes to rest at the edge of + its envelope. To keep evolving, the objective has to give headroom a value, or the plant or its bounds + have to change. +9. **An adversary gets nowhere.** 3,006 proposals built to break the loop ended as 55 `bounds`, 1604 `budget`, 1278 `distance`, 64 `ok`, 5 `worse`. The budget ran + out after 64 changes, and every design held was inside every limit and bound. ## The shortest path from here @@ -81,8 +118,10 @@ Each step has a proposal in [PROPOSALS.md](PROPOSALS.md) and an issue on GitHub. - **"End to end"**: at least one margin in the vector comes from a sensor, and at least one admitted step changes something real. - **"Recursively improving intelligence"**: a model proposes, and what it learns from refusals changes what it - proposes next. Today the only thing that adapts is a step size. + proposes next. Within a recorded run this now happens, and once it has happened across two runs, through + notes passed by hand. Nothing yet does that without a person, and nothing improves the proposer itself. - **"Hardware and software"**: an admitted hardware change is one a machine could make, with its own process limits in the margin vector. -None of these is true today. The gate, the loop and the record are in place for them to plug into. +The first, second and fourth are not true today. The third is true of two recorded runs. The gate, the +model, the loop and the record are in place for the rest to plug into. diff --git a/formal/BAR-REPORT.md b/formal/BAR-REPORT.md index 93bab7a..2f1859e 100644 --- a/formal/BAR-REPORT.md +++ b/formal/BAR-REPORT.md @@ -1,9 +1,10 @@ # Bar report The output of the Proven Commons bar check on this project, run on 2026-11-17 with -`python3 bar/check.py formal --offline` from Proven-Commons/mission at commit +`python3 bar/check.py formal --run-tests --offline` from Proven-Commons/mission at commit `7b22e542f0db0f3013ab1439cf5d1947676a5083`. Rerun it to check. Item 7 reads SKIP because the run was -offline, so the branch rule on GitHub was not read. +offline, so the branch rule on GitHub was not read. In CI the same check reads it and reports item 7 as +OPEN: the default branch does not yet require the `bar / bar` check, which only a repository admin can set. ## Verified bar 2: plantgate @@ -12,11 +13,10 @@ Project status in bar.toml: `in-progress`. | # | Item | Status | Detail | |---|------|--------|--------| -| 1 | Specification public, approved by a separate reviewer, and pinned | OPEN | no approval recorded; the current spec hash is 504d8f56a9fa49307c42ec462a76883db50c35ab6feb0e94ea84e92ef37cd455 | -| 2 | Each public claim names the theorem behind it | PASS | 'What is proved' names all 8 theorems; that the claims match them would rest on a spec approval (item 1), which is not in place | -| 3 | Proofs match the approved statements, in one command | PASS | `lake comparator --paranoid` accepts all 8 theorems under every bundled kernel, and each statement depends only on the spec files, the code under proof, and code outside the project | +| 1 | Specification public, approved by a separate reviewer, and pinned | OPEN | no approval recorded; the current spec hash is 6531b84894f8c75cd679358ae933812648e928c2e2855114165d3b7654c5a54a | +| 2 | Each public claim names the theorem behind it | PASS | 'What is proved' names all 15 theorems; that the claims match them would rest on a spec approval (item 1), which is not in place | +| 3 | Proofs match the approved statements, in one command | PASS | `lake comparator --paranoid` accepts all 15 theorems under every bundled kernel, and each statement depends only on the spec files, the code under proof, and code outside the project | | 4 | The code that runs is the code that was proved | PASS | 4 Lean files, none uses a forbidden feature; that the entry points call the proved functions would rest on a spec approval (item 1), which is not in place | -| 5 | Differential tests ran, with the record in the repo | PASS | 300,000 inputs, seed 20261117, 0 failures, oracle Python 3.13.18 exact gate in `tests/oracle.py` | +| 5 | Differential tests ran, with the record in the repo | PASS | 405,000 inputs, seed 20261117, 0 failures, oracle Python 3.13.18 exact gate and plant model in `tests/oracle.py` | | 6 | The public page lists what is outside the proof | PASS | all sections present; that they are accurate would rest on a spec approval (item 1), which is not in place | | 7 | The check runs in CI | SKIP | .github/workflows/bar.yml calls the verified-bar workflow; the branch rule was not read (--offline) | - diff --git a/formal/Main.lean b/formal/Main.lean index 29b7609..f15045b 100644 --- a/formal/Main.lean +++ b/formal/Main.lean @@ -5,8 +5,19 @@ h LIMIT BUDGET COST ; BASE ... ; CAND ... radius = headroom of BASE under LIMIT r RADIUS BUDGET COST ; BASE ... ; CAND ... radius given - It prints the verdict and the budget left. It calls the proved functions, - not copies of them. + It prints the verdict and the budget left. A line with eight parts is + one proposed design, run through the model, the bounds, the gate and the + objective: + + g LIMIT BUDGET ; PLANT (9) ; SCENARIO (5) ; LOW (5) ; HIGH (5) ; FIXED ... ; HELD (5) ; PROPOSED (5) + + It prints the verdict, the budget left, the objective of the design held + and of the one proposed, and the margins of the one proposed. A line that + starts with `l` is a whole run: the same seven parts with the start design + in place of HELD, then any number of proposed designs, each after a `;`. + It goes through the proved `loop` and `changes` and prints the design held + at the end, the budget left and the number of designs taken up. It calls + the proved functions, not copies of them. -/ import PlantGate @@ -24,8 +35,56 @@ def verdictName : Verdict → String | .radius => "radius" | .distance => "distance" +def ints (s : String) : Option (List Int) := + (words s).mapM String.toInt? + +def genomeOf : List Int → Option Genome + | [a, b, c, d, e] => some ⟨a, b, c, d, e⟩ + | _ => none + +def plantOf (pl fixed : List Int) (lo hi : Genome) : Option Plant := + match pl with + | [pIt, cop, uaRoof, wallArea, dT, other, passive, aux, loopCop] => + some ⟨pIt, cop, uaRoof, wallArea, dT, other, passive, aux, loopCop, fixed, lo, hi⟩ + | _ => none + +def scenarioOf : List Int → Option Scenario + | [outMin, nOut, lowPpm, lowH, hours] => some ⟨outMin, nOut, lowPpm, lowH, hours⟩ + | _ => none + +/-- One proposed design. `accepts` and `step` decide; the name of a refusal is for the reader. -/ +def design (limit budget : Int) (p : Plant) (y : Scenario) (b c : Genome) : String := + let j := judge p y limit (b, budget) c + let name := + if accepts p y limit (b, budget) c = true then "ok" + else if inBounds p.lo p.hi c = false then "bounds" + else if j.verdict ≠ Verdict.ok then verdictName j.verdict + else "worse" + let after := step p y limit (b, budget) c + let ms := " ".intercalate ((margins p y c).map toString) + s!"{name} {after.2} {objective p y b} {objective p y c} ; {ms}" + +/-- A whole list of proposed designs, through the proved `loop` and `changes`. -/ +def wholeLoop (limit budget : Int) (p : Plant) (y : Scenario) (start : Genome) (cands : List Genome) : String := + let fin := loop p y limit (start, budget) cands + s!"{fin.1.pcm} {fin.1.capture} {fin.1.wallU} {fin.1.floor} {fin.1.shed} {fin.2} {changes p y limit (start, budget) cands}" + def answer (line : String) : String := match line.splitOn ";" with + | head :: pl :: sc :: lo :: hi :: fixed :: held :: rest => + match words head, ints pl, ints sc, (ints lo).bind genomeOf, (ints hi).bind genomeOf, ints fixed, + (ints held).bind genomeOf, rest.mapM (fun r => (ints r).bind genomeOf) with + | [mode, limit, budget], some pl, some sc, some lo, some hi, some fixed, some held, some cands => + match limit.toInt?, budget.toInt?, plantOf pl fixed lo hi, scenarioOf sc with + | some limit, some budget, some p, some y => + if mode = "g" then + match cands with + | [cand] => design limit budget p y held cand + | _ => "error" + else if mode = "l" then wholeLoop limit budget p y held cands + else "error" + | _, _, _, _ => "error" + | _, _, _, _, _, _, _, _ => "error" | [head, base, cand] => match words head, (words base).mapM String.toInt?, (words cand).mapM String.toInt? with | [mode, x, budget, cost], some b, some c => diff --git a/formal/PlantGate.lean b/formal/PlantGate.lean index 6068088..9b84da4 100644 --- a/formal/PlantGate.lean +++ b/formal/PlantGate.lean @@ -9,6 +9,11 @@ `gate` is the gate. `evolve` applies one proposed change: an admitted candidate becomes the new baseline. `run` applies a whole list of proposals, whatever proposed them. + + The second half is the plant model and the loop over designs. A `Genome` + is a design: three hardware numbers and two software numbers. `margins` + turns a design into the margin vector and `objective` scores it. `step` + applies one proposed design, `loop` a whole list of them. -/ namespace PlantGate @@ -73,4 +78,193 @@ def acceptedCount (limit : Int) : List Int × Int → List (List Int × Int) → (if (gate s.1 cand (headroom limit s.1) s.2 cost).verdict = Verdict.ok then 1 else 0) + acceptedCount limit (evolve limit s cand cost) rest +/-! ## The plant model -/ + +/-- A design: what the loop may change. -/ +structure Genome where + /-- Thermal store, kWh of heat. Hardware. -/ + pcm : Int + /-- Share of the IT heat captured in liquid, parts per million. Hardware. -/ + capture : Int + /-- Wall U-value, mW/m²K. Hardware. -/ + wallU : Int + /-- The scheduler's load floor, kW. Software. -/ + floor : Int + /-- Share of the load the scheduler sheds in a cooling outage, parts per million. Software. -/ + shed : Int + deriving DecidableEq + +/-- The pinned plant: what no gene changes. -/ +structure Plant where + /-- IT load, W. -/ + pIt : Int + /-- COP of the sorption chiller, parts per million. -/ + cop : Int + /-- Roof conductance, mW/K. -/ + uaRoof : Int + /-- Wall area, m². -/ + wallArea : Int + /-- Design temperature difference across the envelope, mK. -/ + dT : Int + /-- Other overhead, W. -/ + other : Int + /-- Heat taken by the passive sinks, W. -/ + passive : Int + /-- Auxiliaries, W. -/ + aux : Int + /-- COP of the cooling loop, thousandths. -/ + loopCop : Int + /-- The certified margins no gene moves, parts per million of their limits. -/ + fixed : List Int + /-- The smallest value of each gene that could be built or set. -/ + lo : Genome + /-- The largest value of each gene that could be built or set. -/ + hi : Genome + +/-- The year the objective is scored on. -/ +structure Scenario where + /-- Length of one cooling outage, minutes. -/ + outMin : Int + /-- Cooling outages in the year. -/ + nOut : Int + /-- Demand in the low period as a share of the IT load, parts per million. -/ + lowPpm : Int + /-- Hours of low demand in the year. -/ + lowH : Int + /-- Hours in the year. -/ + hours : Int + +/-- `a / b` rounded up, for a positive `b`. -/ +def ceilDiv (a b : Int) : Int := (a + b - 1) / b + +/-- A demand over a capacity, in parts per million and rounded up, so that + a margin is never understated. A capacity that is not positive cannot + be met at all and reads as ten times the limit. So does any ratio + above ten. -/ +def ppm (num den : Int) : Int := + if den ≤ 0 then 10000000 else min 10000000 (ceilDiv (1000000 * num) den) + +/-- The fixed heat load in microwatts: what comes through the roof and the + walls, plus the other overhead. -/ +def qFix (p : Plant) (g : Genome) : Int := + (p.uaRoof + g.wallU * p.wallArea) * p.dT + p.other * 1000000 + +/-- Cooling the plant needs at full load: the IT heat the liquid loop does + not capture, plus the fixed heat load. Scaled to the unit of `driveDen`. -/ +def driveNum (p : Plant) (g : Genome) : Int := + ((1000000 - g.capture) * (p.pIt * 1000000) + 1000000 * qFix p g) * 1000000 + +/-- Cooling the sorption chiller can make at full load: the heat the liquid + loop captures, times the chiller's COP. -/ +def driveDen (p : Plant) (g : Genome) : Int := + p.cop * g.capture * (p.pIt * 1000000) + +/-- Cooling gained per unit of IT load beyond what that load itself needs: + `(1 + COP) × capture − 1`, in parts per million squared. -/ +def coolGain (p : Plant) (g : Genome) : Int := + (1000000 + p.cop) * g.capture - 1000000000000 + +/-- The fixed heat load, in the unit of `coolGain p g * g.floor`. -/ +def floorNum (p : Plant) (g : Genome) : Int := qFix p g * 1000 + +/-- IT heat the store must take in one outage, after shedding. The fixed + heat load is not counted here. -/ +def outageNum (p : Plant) (sc : Scenario) (g : Genome) : Int := + p.pIt * (1000000 - g.shed) * sc.outMin + +/-- What the store holds, in the unit of `outageNum`. -/ +def outageDen (g : Genome) : Int := 60000000000 * g.pcm + +/-- Margin: cooling needed over cooling the captured heat can drive. -/ +def driveMargin (p : Plant) (g : Genome) : Int := ppm (driveNum p g) (driveDen p g) + +/-- Margin: the plant's load floor over the scheduler's load floor. -/ +def floorMargin (p : Plant) (g : Genome) : Int := + if coolGain p g ≤ 0 ∨ g.floor ≤ 0 then 10000000 + else ppm (floorNum p g) (coolGain p g * g.floor) + +/-- Margin: outage heat over what the store holds. -/ +def outageMargin (p : Plant) (sc : Scenario) (g : Genome) : Int := + ppm (outageNum p sc g) (outageDen g) + +/-- The margin vector of a design: the certified margins, then the three + that move with the genes. -/ +def margins (p : Plant) (sc : Scenario) (g : Genome) : List Int := + p.fixed ++ [driveMargin p g, floorMargin p g, outageMargin p sc g] + +/-- Utility power for an IT load `x` in microwatts, times the loop COP. -/ +def utility (p : Plant) (x : Int) : Int := + x * p.loopCop + (x - p.passive * 1000000) * 1000 + (p.aux + p.other) * 1000000 * p.loopCop + +/-- The objective: useful IT energy over utility energy for the scenario + year, in parts per million and rounded down. Load the scheduler adds + to reach its floor is not useful. Load shed in an outage is lost. -/ +def objective (p : Plant) (sc : Scenario) (g : Genome) : Int := + let full := p.pIt * 1000000 + let low := sc.lowPpm * p.pIt + let itLow := max low (g.floor * 1000000000) + let shedP := g.shed * p.pIt + let tFull := (sc.hours - sc.lowH) * 60 + let tLow := sc.lowH * 60 + let tOut := sc.outMin * sc.nOut + let useful := full * tFull + low * tLow - shedP * tOut + let used := utility p full * tFull + utility p itLow * tLow - utility p shedP * tOut + if used ≤ 0 then 0 else (1000000 * useful * p.loopCop) / used + +/-- Whether `x` lies from `lo` to `hi`. -/ +def between (lo hi x : Int) : Bool := decide (lo ≤ x) && decide (x ≤ hi) + +/-- Whether every gene lies within what could be built or set. -/ +def inBounds (lo hi g : Genome) : Bool := + between lo.pcm hi.pcm g.pcm && between lo.capture hi.capture g.capture + && between lo.wallU hi.wallU g.wallU && between lo.floor hi.floor g.floor + && between lo.shed hi.shed g.shed + +/-! ## The loop over designs -/ + +/-- The gate's answer for a proposed design. The radius is the headroom + of the design held now, and a change costs one unit of budget. -/ +def judge (p : Plant) (sc : Scenario) (limit : Int) (s : Genome × Int) (cand : Genome) : Outcome := + gate (margins p sc s.1) (margins p sc cand) (headroom limit (margins p sc s.1)) s.2 1 + +/-- Whether a proposed design is taken up. It must lie within the bounds, + pass the gate, and not lower the objective. -/ +def accepts (p : Plant) (sc : Scenario) (limit : Int) (s : Genome × Int) (cand : Genome) : Bool := + inBounds p.lo p.hi cand && decide ((judge p sc limit s cand).verdict = Verdict.ok) + && decide (objective p sc s.1 ≤ objective p sc cand) + +/-- One generation over designs. A design that is taken up becomes the + one held, and the budget falls to what the gate left. Otherwise + nothing changes. -/ +def step (p : Plant) (sc : Scenario) (limit : Int) (s : Genome × Int) (cand : Genome) : Genome × Int := + if accepts p sc limit s cand = true then (cand, (judge p sc limit s cand).remaining) else s + +/-- Any number of generations, one proposed design after another. -/ +def loop (p : Plant) (sc : Scenario) (limit : Int) : Genome × Int → List Genome → Genome × Int + | s, [] => s + | s, cand :: rest => loop p sc limit (step p sc limit s cand) rest + +/-- How many of the proposed designs were taken up. -/ +def changes (p : Plant) (sc : Scenario) (limit : Int) : Genome × Int → List Genome → Nat + | _, [] => 0 + | s, cand :: rest => + (if accepts p sc limit s cand = true then 1 else 0) + + changes p sc limit (step p sc limit s cand) rest + +/-! ## What the limits mean, stated without rounding -/ + +/-- The captured heat, through the chiller, covers the cooling the plant + needs at full load. For a scheduler floor at or below the IT load this + follows from `SelfCoolsAtFloor`. -/ +def DriveHeatSuffices (p : Plant) (g : Genome) : Prop := + 0 < driveDen p g ∧ driveNum p g ≤ driveDen p g + +/-- At the scheduler's load floor the plant still cools itself. -/ +def SelfCoolsAtFloor (p : Plant) (g : Genome) : Prop := + 0 < coolGain p g ∧ 0 < g.floor ∧ floorNum p g ≤ coolGain p g * g.floor + +/-- The store holds the IT heat of one outage, after shedding. -/ +def RidesThrough (p : Plant) (sc : Scenario) (g : Genome) : Prop := + 0 < outageDen g ∧ outageNum p sc g ≤ outageDen g + end PlantGate diff --git a/formal/PlantGate/Proofs.lean b/formal/PlantGate/Proofs.lean index d0c2172..22cdb81 100644 --- a/formal/PlantGate/Proofs.lean +++ b/formal/PlantGate/Proofs.lean @@ -81,6 +81,72 @@ theorem within_of (limit r : Int) (hr : 0 ≤ r) : · exact within_of limit r hr bs cs (by simpa using hl) (by omega) (fun b' hb' => hh b' (by simp [hb'])) x hx' +theorem headroom_nonneg (limit : Int) : + ∀ (base : List Int), (∀ b ∈ base, b ≤ limit) → 0 ≤ headroom limit base + | [], _ => by simp [headroom] + | [b0], h => by + have h0 := h b0 (by simp) + simp only [headroom] + omega + | b0 :: b1 :: bs, h => by + have ih := headroom_nonneg limit (b1 :: bs) (fun b hb => h b (by simp [hb])) + have e : headroom limit (b0 :: b1 :: bs) = min (limit - b0) (headroom limit (b1 :: bs)) := by + simp [headroom] + rw [e] + have h0 := h b0 (by simp) + exact Int.le_min.mpr ⟨by omega, ih⟩ + +/-- A margin at or below 1,000,000 means the demand is at most the capacity, exactly. -/ +theorem ppm_le (num den : Int) (h : ppm num den ≤ 1000000) : 0 < den ∧ num ≤ den := by + unfold ppm at h + by_cases hd : den ≤ 0 + · simp only [hd, ↓reduceIte] at h + omega + · simp only [hd, ↓reduceIte] at h + have hpos : 0 < den := by omega + refine ⟨hpos, ?_⟩ + by_cases hn : num ≤ den + · exact hn + · have h1 : (1000001 : Int) * den ≤ 1000000 * num + den - 1 := by omega + have h2 : (1000001 : Int) ≤ (1000000 * num + den - 1) / den := Int.le_ediv_of_mul_le hpos h1 + unfold ceilDiv at h + rw [Int.min_def] at h + split at h <;> omega + +theorem margins_ne_nil (p : Plant) (sc : Scenario) (g : Genome) : margins p sc g ≠ [] := by + simp [margins] + +theorem margins_length (p : Plant) (sc : Scenario) (a b : Genome) : + (margins p sc a).length = (margins p sc b).length := by + simp [margins] + +theorem moving_le (p : Plant) (sc : Scenario) (g : Genome) (limit : Int) + (hw : ∀ x ∈ margins p sc g, x ≤ limit) : + driveMargin p g ≤ limit ∧ floorMargin p g ≤ limit ∧ outageMargin p sc g ≤ limit := by + refine ⟨hw _ ?_, hw _ ?_, hw _ ?_⟩ <;> simp [margins] + +theorem physics_of (p : Plant) (sc : Scenario) (g : Genome) + (hw : ∀ x ∈ margins p sc g, x ≤ 1000000) : + DriveHeatSuffices p g ∧ SelfCoolsAtFloor p g ∧ RidesThrough p sc g := by + have m := moving_le p sc g 1000000 hw + refine ⟨ppm_le _ _ m.1, ?_, ppm_le _ _ m.2.2⟩ + have hf := m.2.1 + unfold floorMargin at hf + by_cases hc : coolGain p g ≤ 0 ∨ g.floor ≤ 0 + · simp only [hc, ↓reduceIte] at hf + omega + · simp only [hc, ↓reduceIte] at hf + have a := ppm_le _ _ hf + have h1 : 0 < coolGain p g := by + by_cases h : coolGain p g ≤ 0 + · exact absurd (Or.inl h) hc + · omega + have h2 : 0 < g.floor := by + by_cases h : g.floor ≤ 0 + · exact absurd (Or.inr h) hc + · omega + exact ⟨h1, h2, a.2⟩ + end PlantGate.Proofs open PlantGate.Proofs @@ -204,3 +270,150 @@ theorem PlantGate.Spec.run_bounded (limit : Int) (steps : List (List Int × Int) simp only [h, ite_false] rw [e] at r ⊢ omega + +namespace PlantGate.Proofs + +/-- An admitted design has margins within the limit and cost exactly one unit. -/ +theorem judge_ok (p : Plant) (sc : Scenario) (limit : Int) (s : Genome × Int) (cand : Genome) + (h : (judge p sc limit s cand).verdict = Verdict.ok) : + (∀ x ∈ margins p sc cand, x ≤ limit) ∧ (judge p sc limit s cand).remaining = s.2 - 1 + ∧ 1 ≤ s.2 := by + unfold judge at h ⊢ + have a := PlantGate.Spec.accepted_stays_within limit _ _ _ _ h + have g := PlantGate.Spec.gate_ok_sound _ _ _ _ _ h + exact ⟨a, g.2.2.2.2.2, g.2.1⟩ + +/-- A step either takes the design up, with everything that implies, or changes nothing. -/ +theorem step_cases (p : Plant) (sc : Scenario) (limit : Int) (s : Genome × Int) (cand : Genome) : + (accepts p sc limit s cand = true + ∧ step p sc limit s cand = (cand, s.2 - 1) + ∧ inBounds p.lo p.hi cand = true + ∧ (∀ x ∈ margins p sc cand, x ≤ limit) + ∧ 1 ≤ s.2 + ∧ objective p sc s.1 ≤ objective p sc cand) + ∨ (accepts p sc limit s cand = false ∧ step p sc limit s cand = s) := by + by_cases h : accepts p sc limit s cand = true + · left + have h' := h + simp only [accepts, Bool.and_eq_true, decide_eq_true_eq] at h' + have j := judge_ok p sc limit s cand h'.1.2 + refine ⟨h, ?_, h'.1.1, j.1, j.2.2, h'.2⟩ + simp [step, h, j.2.1] + · right + have h2 : accepts p sc limit s cand = false := by simpa using h + exact ⟨h2, by simp [step, h2]⟩ + +end PlantGate.Proofs + +theorem PlantGate.Spec.step_complete (p : Plant) (sc : Scenario) (limit : Int) + (s : Genome × Int) (cand : Genome) + (hb : 0 < s.2) (hin : inBounds p.lo p.hi cand = true) + (hw : ∀ x ∈ margins p sc s.1, x ≤ limit) + (hd : distSq (margins p sc s.1) (margins p sc cand) + ≤ headroom limit (margins p sc s.1) * headroom limit (margins p sc s.1)) + (ho : objective p sc s.1 ≤ objective p sc cand) : + step p sc limit s cand = (cand, s.2 - 1) := by + have hv : (judge p sc limit s cand).verdict = Verdict.ok := by + unfold judge + exact PlantGate.Spec.gate_complete _ _ _ _ _ (by omega) (by omega) (margins_ne_nil p sc s.1) + (margins_length p sc s.1 cand) (headroom_nonneg limit _ hw) hd + have ha : accepts p sc limit s cand = true := by + simp [accepts, hin, hv, ho] + rcases step_cases p sc limit s cand with ⟨_, e, _⟩ | ⟨hf, _⟩ + · exact e + · rw [ha] at hf + exact absurd hf (by simp) + +theorem PlantGate.Spec.step_refusal_changes_nothing (p : Plant) (sc : Scenario) (limit : Int) + (s : Genome × Int) (cand : Genome) + (h : accepts p sc limit s cand = false) : + step p sc limit s cand = s := by + simp [step, h] + +theorem PlantGate.Proofs.loop_margins (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) + (hw : ∀ x ∈ margins p sc s.1, x ≤ limit) : + ∀ x ∈ margins p sc (loop p sc limit s cands).1, x ≤ limit := by + induction cands generalizing s with + | nil => exact hw + | cons cand rest ih => + simp only [loop] + apply ih + rcases step_cases p sc limit s cand with ⟨_, e, _, hm, _⟩ | ⟨_, e⟩ + · rw [e] + exact hm + · rw [e] + exact hw + +theorem PlantGate.Spec.loop_safe (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) + (hw : ∀ x ∈ margins p sc s.1, x ≤ limit) (hb : 0 ≤ s.2) : + (∀ x ∈ margins p sc (loop p sc limit s cands).1, x ≤ limit) + ∧ 0 ≤ (loop p sc limit s cands).2 ∧ (loop p sc limit s cands).2 ≤ s.2 := by + refine ⟨PlantGate.Proofs.loop_margins p sc limit cands s hw, ?_⟩ + induction cands generalizing s with + | nil => exact ⟨hb, by simp [loop]⟩ + | cons cand rest ih => + simp only [loop] + rcases step_cases p sc limit s cand with ⟨_, e, _, hm, h1, _⟩ | ⟨_, e⟩ + · have r := ih (step p sc limit s cand) (by rw [e]; exact hm) (by rw [e]; show 0 ≤ s.2 - 1; omega) + rw [e] at r ⊢ + have r2 : (loop p sc limit (cand, s.2 - 1) rest).2 ≤ s.2 - 1 := r.2 + exact ⟨r.1, by omega⟩ + · rw [e] + exact ih s hw hb + +theorem PlantGate.Spec.loop_in_bounds (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) + (h : inBounds p.lo p.hi s.1 = true) : + inBounds p.lo p.hi (loop p sc limit s cands).1 = true := by + induction cands generalizing s with + | nil => exact h + | cons cand rest ih => + simp only [loop] + apply ih + rcases step_cases p sc limit s cand with ⟨_, e, hin, _⟩ | ⟨_, e⟩ + · rw [e] + exact hin + · rw [e] + exact h + +theorem PlantGate.Spec.loop_never_worse (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) : + objective p sc s.1 ≤ objective p sc (loop p sc limit s cands).1 := by + induction cands generalizing s with + | nil => exact Int.le_refl _ + | cons cand rest ih => + simp only [loop] + have r := ih (step p sc limit s cand) + rcases step_cases p sc limit s cand with ⟨_, e, _, _, _, ho⟩ | ⟨_, e⟩ + · rw [e] at r ⊢ + exact Int.le_trans ho r + · rw [e] at r ⊢ + exact r + +theorem PlantGate.Spec.loop_bounded (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) : + (changes p sc limit s cands : Int) + (loop p sc limit s cands).2 ≤ s.2 := by + induction cands generalizing s with + | nil => simp [changes, loop] + | cons cand rest ih => + have r := ih (step p sc limit s cand) + simp only [changes, loop] + rcases step_cases p sc limit s cand with ⟨ha, e, _⟩ | ⟨hf, e⟩ + · simp only [ha, ↓reduceIte] + rw [e] at r ⊢ + have r2 : (changes p sc limit (cand, s.2 - 1) rest : Int) + + (loop p sc limit (cand, s.2 - 1) rest).2 ≤ s.2 - 1 := r + omega + · simp only [hf, Bool.false_eq_true, ↓reduceIte] + rw [e] at r ⊢ + omega + +theorem PlantGate.Spec.loop_keeps_physics (p : Plant) (sc : Scenario) + (cands : List Genome) (s : Genome × Int) + (hw : ∀ x ∈ margins p sc s.1, x ≤ 1000000) : + DriveHeatSuffices p (loop p sc 1000000 s cands).1 + ∧ SelfCoolsAtFloor p (loop p sc 1000000 s cands).1 + ∧ RidesThrough p sc (loop p sc 1000000 s cands).1 := + physics_of p sc _ (PlantGate.Proofs.loop_margins p sc 1000000 cands s hw) diff --git a/formal/PlantGate/Spec.lean b/formal/PlantGate/Spec.lean index c140c40..c2402de 100644 --- a/formal/PlantGate/Spec.lean +++ b/formal/PlantGate/Spec.lean @@ -67,3 +67,67 @@ theorem PlantGate.Spec.run_safe (limit : Int) (steps : List (List Int × Int)) ( changes the system can ever make to itself. -/ theorem PlantGate.Spec.run_bounded (limit : Int) (steps : List (List Int × Int)) (s : List Int × Int) : (acceptedCount limit s steps : Int) + (run limit s steps).2 ≤ s.2 := sorry + +/-- Usefulness of the loop over designs: a design within the bounds that + stays within the headroom and does not lower the objective is taken + up, for one unit of budget. A loop that takes nothing up passes the + safety statements below and fails this one. -/ +theorem PlantGate.Spec.step_complete (p : Plant) (sc : Scenario) (limit : Int) + (s : Genome × Int) (cand : Genome) + (hb : 0 < s.2) (hin : inBounds p.lo p.hi cand = true) + (hw : ∀ x ∈ margins p sc s.1, x ≤ limit) + (hd : distSq (margins p sc s.1) (margins p sc cand) + ≤ headroom limit (margins p sc s.1) * headroom limit (margins p sc s.1)) + (ho : objective p sc s.1 ≤ objective p sc cand) : + step p sc limit s cand = (cand, s.2 - 1) := sorry + +/-- A proposed design that is not taken up changes nothing: the design + held and the budget are as they were. -/ +theorem PlantGate.Spec.step_refusal_changes_nothing (p : Plant) (sc : Scenario) (limit : Int) + (s : Genome × Int) (cand : Genome) + (h : accepts p sc limit s cand = false) : + step p sc limit s cand = s := sorry + +/-- The loop over designs is safe against any proposer. Start from a + design whose margins are within the limit, with a budget that is not + negative. After any list of proposed designs whatever, the margins of + the design held, as this model computes them, are still within the + limit, the budget is not negative and it has not grown. -/ +theorem PlantGate.Spec.loop_safe (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) + (hw : ∀ x ∈ margins p sc s.1, x ≤ limit) (hb : 0 ≤ s.2) : + (∀ x ∈ margins p sc (loop p sc limit s cands).1, x ≤ limit) + ∧ 0 ≤ (loop p sc limit s cands).2 ∧ (loop p sc limit s cands).2 ≤ s.2 := sorry + +/-- The design held never leaves the bounds it started in. -/ +theorem PlantGate.Spec.loop_in_bounds (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) + (h : inBounds p.lo p.hi s.1 = true) : + inBounds p.lo p.hi (loop p sc limit s cands).1 = true := sorry + +/-- The loop never gets worse. Whatever is proposed, the objective of the + design held at the end is at least the objective at the start. A design + that scores the same is taken up, so this does not say that every + change is an improvement. -/ +theorem PlantGate.Spec.loop_never_worse (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) : + objective p sc s.1 ≤ objective p sc (loop p sc limit s cands).1 := sorry + +/-- The number of designs taken up plus the budget left never exceeds the + budget at the start. -/ +theorem PlantGate.Spec.loop_bounded (p : Plant) (sc : Scenario) (limit : Int) + (cands : List Genome) (s : Genome × Int) : + (changes p sc limit s cands : Int) + (loop p sc limit s cands).2 ≤ s.2 := sorry + +/-- What the limit means. With the limit at 1,000,000 parts per million, + start from a design whose margins are within it. After any list of + proposed designs, the design held still has enough captured heat to + drive its chiller, still cools itself at the scheduler's load floor, + and still holds one outage in its store. These are exact + inequalities: the rounding of the margins plays no part. -/ +theorem PlantGate.Spec.loop_keeps_physics (p : Plant) (sc : Scenario) + (cands : List Genome) (s : Genome × Int) + (hw : ∀ x ∈ margins p sc s.1, x ≤ 1000000) : + DriveHeatSuffices p (loop p sc 1000000 s cands).1 + ∧ SelfCoolsAtFloor p (loop p sc 1000000 s cands).1 + ∧ RidesThrough p sc (loop p sc 1000000 s cands).1 := sorry diff --git a/formal/README.md b/formal/README.md index 7059046..f13db10 100644 --- a/formal/README.md +++ b/formal/README.md @@ -1,6 +1,6 @@ -# plantgate: an exact gate for a plant, proved in Lean +# plantgate: an exact gate, plant model and improvement loop, proved in Lean -This is the formal core of [optifab](../README.md). It is a gate that decides whether a proposed change to a plant may go ahead, and the loop that applies such changes generation after generation. It follows the layout and the rules of the Proven Commons [verified bar](https://github.com/Proven-Commons/mission/blob/main/playbook/verified-bar.md). +This is the formal core of [optifab](../README.md). It is a gate that decides whether a proposed change to a plant may go ahead, a model that turns a design into its margins and its objective, and the loop that takes up proposed designs generation after generation. It follows the layout and the rules of the Proven Commons [verified bar](https://github.com/Proven-Commons/mission/blob/main/playbook/verified-bar.md). Status: in progress. The specification has not been approved by a reviewer, so this is not verified. @@ -16,16 +16,31 @@ Status: in progress. The specification has not been approved by a reviewer, so t | When the radius is the headroom of the baseline, an admitted candidate has every margin at or below the limit. | `PlantGate.Spec.accepted_stays_within` | | Whatever is proposed, and in whatever order, the loop keeps every margin at or below the limit and never overdraws the budget. | `PlantGate.Spec.run_safe` | | The number of changes the loop admits is at most the budget it was given. | `PlantGate.Spec.run_bounded` | +| With budget left and the design held within the limit, a proposed design that lies within the bounds, stays within the headroom and does not lower the objective is taken up, for one unit of budget. | `PlantGate.Spec.step_complete` | +| A proposed design that is not taken up changes nothing: the design held and the budget stay as they were. | `PlantGate.Spec.step_refusal_changes_nothing` | +| Start from a design whose margins are within the limit, with a budget that is not negative. Whatever designs are proposed, the margins of the design held, as the model computes them, stay at or below the limit, and the budget is never overdrawn. | `PlantGate.Spec.loop_safe` | +| A design that starts within the bounds never leaves them. | `PlantGate.Spec.loop_in_bounds` | +| Whatever designs are proposed, the objective of the design held never falls. It may stay the same. | `PlantGate.Spec.loop_never_worse` | +| The number of designs taken up is at most the budget. | `PlantGate.Spec.loop_bounded` | +| With the limit at 1,000,000 parts per million, start from a design whose margins are within it. The design held then always has captured heat enough for the cooling it needs at full load, always cools itself at the scheduler's load floor, and always holds the IT heat of one outage in its store. These are exact inequalities, free of rounding. | `PlantGate.Spec.loop_keeps_physics` | -The statements are in `PlantGate/Spec.lean`, the proofs in `PlantGate/Proofs.lean`. The command-line tool in `Main.lean` calls the proved `PlantGate.gate` and `PlantGate.headroom` directly. +The statements are in `PlantGate/Spec.lean`, the proofs in `PlantGate/Proofs.lean`. The command-line tool in `Main.lean` calls the proved `PlantGate.gate` and `PlantGate.headroom` directly for a gate line, the proved `PlantGate.accepts`, `PlantGate.step`, `PlantGate.margins` and `PlantGate.objective` for a design line, and the proved `PlantGate.loop` and `PlantGate.changes` for a whole run. + +The first eight theorems are about the gate and take margins as given. The last seven are about designs. In them the three margins that move with the genes, and the objective, are computed inside the proved code. The eleven margins carried as constants, the plant's nine numbers, the bounds, the scenario and the limit are still inputs. + +The model is not proved. It is defined in the code under proof, and the theorems say what the loop does with it. ## What is not proved -- That the margins given to the gate are true. They are computed by other verifiers from models. No sensor exists yet. -- That an admitted change is an improvement. The gate bounds harm and says nothing about benefit. +- That the model describes a real plant. `loop_keeps_physics` is about the model's own inequalities. Its constants come from other repositories' certificates, which are claimed and not measured. No sensor exists yet. +- That the eleven margins the model carries as constants are true. Ten are certified by other verifiers and one is derived in `verify.py`. +- That the model is free of mistakes. `SPEC.md` lists five known defects, found by an independent read: the objective's outage term, the outage margin, equal-scoring designs being taken up and charged, the lack of any requirement that the inputs make sense, and two limits on what the loop can do. +- That the bounds are what could really be built or set. They are declared by a person. +- That a higher objective is a better campus. `loop_never_worse` says the objective never falls. The objective and its scenario are choices. +- That the gate alone admits only improvements. The gate bounds harm. It is the step over designs that also asks for the objective not to fall. - The floating-point gate `plant_gate` in `verify.py`, which is tested against Weft's own gate and compared with this one away from the boundary, but has no proof. - Parsing the input lines and printing the results in `Main.lean`. The differential tests cover them. -- The Python code that proposes changes, evaluates them and keeps the ledger. +- The proposers, and the Python code that keeps the ledger. The Python copy of the model and the step is tested against the Lean one, and every ledger decision is worked out again in Lean from the two designs. - How fast it runs. ## What you must trust @@ -47,7 +62,7 @@ lake comparator --paranoid python3 tests/run_tests.py ``` -`lake comparator --paranoid` builds the project in a sandbox, checks that each theorem in `PlantGate/Proofs.lean` proves exactly the statement in `PlantGate/Spec.lean`, checks that it uses only the axioms `propext`, `Classical.choice`, and `Quot.sound`, and replays it through every kernel shipped with Lean. The test script compares the tool with the oracle on 300,000 inputs and rewrites `tests/TEST-RESULTS.md`. +`lake comparator --paranoid` builds the project in a sandbox, checks that each theorem in `PlantGate/Proofs.lean` proves exactly the statement in `PlantGate/Spec.lean`, checks that it uses only the axioms `propext`, `Classical.choice`, and `Quot.sound`, and replays it through every kernel shipped with Lean. The test script compares the tool with the oracle on 405,000 inputs (300,000 gate decisions, 100,000 proposed designs and 5,000 whole runs) and rewrites `tests/TEST-RESULTS.md`. To run the Proven Commons bar check on it, from a clone of Proven-Commons/mission: @@ -65,5 +80,5 @@ python3 bar/check.py /path/to/optifab/formal --offline - `comparator.json`: which theorems `lake comparator` checks, and which axioms it allows. - `bar.toml`: the project's record for the bar check. - `SPEC.md`: the specification in plain words. -- `tests/oracle.py`: the exact Python gate. +- `tests/oracle.py`: the exact Python gate, plant model and step. - `tests/run_tests.py`: differential tests against the oracle. diff --git a/formal/SPEC.md b/formal/SPEC.md index c9b086f..fec0a50 100644 --- a/formal/SPEC.md +++ b/formal/SPEC.md @@ -1,4 +1,4 @@ -# Specification: the plant gate +# Specification: the plant gate, the plant model and the loop over designs A reviewer who did not write this approves it together with `PlantGate/Spec.lean` and the page sections listed in `bar.toml`. No one has yet. @@ -17,6 +17,26 @@ The gate decides whether one proposed change to a plant may go ahead. It is exac `PlantGate.run limit s steps` applies a list of proposals in order. +The second half is about designs. + +- A **design** (`PlantGate.Genome`) is five integers: the thermal store in kWh of heat, the share of IT heat captured in liquid in parts per million, the wall U-value in mW/m²K, the scheduler's load floor in kW, and the share of load the scheduler sheds in a cooling outage in parts per million. The first three are hardware and the last two are software. +- The **plant** (`PlantGate.Plant`) is what no gene changes: the IT load, the chiller and loop COPs, the envelope, the overheads, the certified margins that are carried as constants, and the lowest and highest value of each gene that could be built or set. +- The **scenario** (`PlantGate.Scenario`) is the year the objective is scored on. + +`PlantGate.margins p sc g` is the margin vector of a design: the certified constants, then three margins that move with the genes. + +| Margin | Demand | Capacity | +|--------|--------|----------| +| drive heat | cooling needed at full load: the uncaptured IT heat plus the fixed heat load | cooling the chiller makes from the heat the liquid loop captures at full load: that heat times the COP | +| load floor | the fixed heat load | the cooling the plant gains per kW of IT load, `(1 + COP) × capture − 1`, times the scheduler's load floor | +| outage | IT load not shed, times the length of one outage. The fixed heat load is not counted. | what the store holds | + +Each is demand over capacity in parts per million, rounded up. A capacity that is not positive reads as 10,000,000, and so does any ratio above ten. + +`PlantGate.objective p sc g` is useful IT energy over utility energy for the scenario year, in parts per million and rounded down. + +`PlantGate.step p sc limit s cand` applies one proposed design to a pair of the design held and the budget. `PlantGate.loop` applies a list of them. `PlantGate.changes` counts the designs taken up. + ## Valid inputs and errors Every input is valid and every function is total. The gate refuses, in this order: @@ -31,6 +51,14 @@ Every input is valid and every function is total. The gate refuses, in this orde Otherwise the verdict is `ok` and the cost is taken from the budget. A refused step leaves the budget unchanged. +A proposed design is taken up when all three of these hold, and otherwise nothing changes: + +| Refusal | When | +|---------|------| +| `bounds` | some gene lies outside the plant's lowest and highest values | +| any gate verdict above | the gate refuses the move from the margins of the design held to the margins of the one proposed, with the headroom of the design held as the radius and a cost of one | +| `worse` | the objective of the proposed design is lower than that of the design held | + ## What must always hold Each property below is a theorem in `PlantGate/Spec.lean`. @@ -45,18 +73,40 @@ Each property below is a theorem in `PlantGate/Spec.lean`. | When the radius is the headroom of the baseline, an admitted candidate has every margin at or below the limit. | `PlantGate.Spec.accepted_stays_within` | | Start within the limit with a budget that is not negative. After any list of proposals, every margin is still at or below the limit, the budget is not negative, and it has not grown. | `PlantGate.Spec.run_safe` | | The number of admitted changes plus the budget left never exceeds the budget at the start. | `PlantGate.Spec.run_bounded` | +| With a budget above zero and the design held within the limit, a proposed design within the bounds, within the headroom and with an objective that is not lower is taken up, and the budget falls by one. | `PlantGate.Spec.step_complete` | +| A proposed design that is not taken up changes nothing: the design held and the budget are as they were. | `PlantGate.Spec.step_refusal_changes_nothing` | +| Start from a design whose margins are within the limit, with a budget that is not negative. After any list of proposed designs, the margins of the design held are still within the limit, the budget is not negative, and it has not grown. | `PlantGate.Spec.loop_safe` | +| Start from a design within the bounds. After any list of proposed designs, the design held is still within them. | `PlantGate.Spec.loop_in_bounds` | +| After any list of proposed designs, the objective of the design held is at least what it was at the start. | `PlantGate.Spec.loop_never_worse` | +| The number of designs taken up plus the budget left never exceeds the budget at the start. | `PlantGate.Spec.loop_bounded` | +| With the limit at 1,000,000, start from a design whose margins are within it. After any list of proposed designs, the design held satisfies three exact inequalities: the cooling needed at full load is at most what the captured heat can drive, the fixed heat load is at most the cooling gained at the scheduler's floor, and the IT heat of one outage is at most what the store holds. The three are not independent: for a scheduler floor at or below the IT load, the first follows from the second. | `PlantGate.Spec.loop_keeps_physics` | The first, third, fourth, fifth and sixth are safety properties. A gate that refuses everything meets them all, so the second is there to rule that gate out. -The last two are about the loop, and they hold for every list of proposals. Nothing is assumed about who or what proposes: a search, a model, or an adversary. `run_safe` says no proposer can push a margin past its limit or overdraw the budget through this gate. `run_bounded` says the number of changes the system can make to itself is at most the budget someone gave it. +`run_safe` and `run_bounded` are about the loop over margin vectors, and they hold for every list of proposals. Nothing is assumed about who or what proposes: a search, a model, or an adversary. `run_safe` says no proposer can push a margin past its limit or overdraw the budget through this gate. `run_bounded` says the number of changes the system can make to itself is at most the budget someone gave it. + +The seven statements about designs go one step further. In them the three margins that move with the genes are not an input: the model inside the proved code computes them from the design. The eleven margins carried as constants still are an input. `step_complete` rules out a loop that takes nothing up, and `step_refusal_changes_nothing` rules out one that loses the design or the budget when it refuses. `loop_never_worse` says no proposer can make the design held score lower. It allows a design that scores the same. `loop_keeps_physics` says what a margin within the limit means, as inequalities with no rounding in them, so a reviewer can check the model against the physics without reading the rounding. + +## Known defects in the model + +An independent read of this specification (2026-11-17) found these. They are in the code under proof as it stands. The theorems are true of that code. Each needs a decision before it is changed, because a change alters every published objective figure and the recorded runs. + +- **The objective's outage term is wrong by a constant.** `objective` subtracts the whole utility power of the shed load during an outage, including the part that does not depend on load. So an outage with nothing shed raises the objective a little: 914,237 with twelve outages against 914,218 with none, for the reference design with no shedding. Subtracting only the saving gives 914,210 for the start design (published 914,228) and 918,990 for the end of the seeded run (published 919,009). The offset is the same for every design, so their order does not change except between designs that tie. +- **The outage margin counts IT heat only.** The drive and floor margins include the fixed heat load, about 213 kW. `outageNum` does not, though that heat also has to go somewhere in an outage: about 71 kWh in twenty minutes. A store of 2,400 kWh passes for the reference design with 30% shed, where IT heat plus fixed heat is 2,404 kWh. +- **A design that scores the same is taken up and charged.** That includes a proposal identical to the design held. So a proposer can spend the whole budget and improve nothing, and can use up headroom at an equal objective. `loop_never_worse` says the objective does not fall. It does not say each change is an improvement. +- **Nothing requires the plant, the bounds, the scenario or the start to make sense.** The theorems hold for negative loads, a capture fraction above one or an outage of zero minutes, and the three inequalities are then true and meaningless. A limit of 10,000,000, which is the value an unmeetable margin reads, lets such a margin pass. Within the declared bounds at a limit of 1,000,000 no meaningless design was found that is taken up. +- **The loop can refuse a safer design and cannot repair an unsafe start.** The radius bounds distance in either direction, so a large move towards safety is refused as `distance`. A start past a limit has negative headroom and nothing is taken up from it. ## What the specification does not say -- That the margins fed to the gate are true. They come from other verifiers and, one day, from sensors. A wrong margin gives a wrong verdict. +- That the model is a true description of a plant, or that its constants are right. They are pinned from other repositories' certificates. +- That the bounds are what could really be built, or that the scenario is the right year to score. + +- That margins fed to the gate from outside are true. Of the eleven carried as constants, ten come from other verifiers and one is derived in `verify.py`. One day they should come from sensors. A wrong margin gives a wrong verdict. - That a candidate inside the radius is a good change. The gate bounds harm. It does not measure benefit. - That the limit is the right limit. It is a number the caller supplies. - Anything about time. The gate is a pure function and takes no account of how fast a state changes. ## Oracle -The original this stands in for is the exact Python gate in `tests/oracle.py`, which the optifab verifier uses to decide every step of its improvement loop. +The original this stands in for is the exact Python gate, plant model and step in `tests/oracle.py`, which the optifab verifier uses to compute every margin and decide every step of its improvement loop. diff --git a/formal/bar.toml b/formal/bar.toml index ce1d35b..14c3d3d 100644 --- a/formal/bar.toml +++ b/formal/bar.toml @@ -31,6 +31,36 @@ code = [ "PlantGate.evolve", "PlantGate.run", "PlantGate.acceptedCount", + "PlantGate.Genome", + "PlantGate.Plant", + "PlantGate.Plant.lo", + "PlantGate.Plant.hi", + "PlantGate.Scenario", + "PlantGate.ceilDiv", + "PlantGate.ppm", + "PlantGate.qFix", + "PlantGate.driveNum", + "PlantGate.driveDen", + "PlantGate.coolGain", + "PlantGate.floorNum", + "PlantGate.outageNum", + "PlantGate.outageDen", + "PlantGate.driveMargin", + "PlantGate.floorMargin", + "PlantGate.outageMargin", + "PlantGate.margins", + "PlantGate.utility", + "PlantGate.objective", + "PlantGate.between", + "PlantGate.inBounds", + "PlantGate.judge", + "PlantGate.accepts", + "PlantGate.step", + "PlantGate.loop", + "PlantGate.changes", + "PlantGate.DriveHeatSuffices", + "PlantGate.SelfCoolsAtFloor", + "PlantGate.RidesThrough", ] # No approval is recorded. The Proven Commons reviewer list is empty, so diff --git a/formal/comparator.json b/formal/comparator.json index 64be1b0..87f4024 100644 --- a/formal/comparator.json +++ b/formal/comparator.json @@ -9,7 +9,18 @@ "PlantGate.Spec.no_margin_rises_past_radius", "PlantGate.Spec.accepted_stays_within", "PlantGate.Spec.run_safe", - "PlantGate.Spec.run_bounded" + "PlantGate.Spec.run_bounded", + "PlantGate.Spec.step_complete", + "PlantGate.Spec.step_refusal_changes_nothing", + "PlantGate.Spec.loop_safe", + "PlantGate.Spec.loop_in_bounds", + "PlantGate.Spec.loop_never_worse", + "PlantGate.Spec.loop_bounded", + "PlantGate.Spec.loop_keeps_physics" ], - "permitted_axioms": ["propext", "Quot.sound", "Classical.choice"] + "permitted_axioms": [ + "propext", + "Quot.sound", + "Classical.choice" + ] } diff --git a/formal/tests/TEST-RESULTS.md b/formal/tests/TEST-RESULTS.md index 589fdf3..ff5c9bd 100644 --- a/formal/tests/TEST-RESULTS.md +++ b/formal/tests/TEST-RESULTS.md @@ -2,10 +2,15 @@ Written by `tests/run_tests.py`. Rerun it to check these numbers. -- Oracle: Python 3.13.18 exact gate in `tests/oracle.py` +- Oracle: Python 3.13.18 exact gate and plant model in `tests/oracle.py` - Lean: Lean (version 4.35.0, x86_64-unknown-linux-gnu, commit eb6cafb7290e8bd5f2937522d8d804f58f02bafc, Release) - Seed: 20261117 -- Inputs: 300000 -- Mutated: 243383 of the inputs sit on, just inside or just outside a radius, a limit or a length +- Inputs: 405000 +- Gate inputs: 300000 +- Mutated: 243383 of the gate inputs sit on, just inside or just outside a radius, a limit or a length - Verdicts: budget 56291, cost 93741, distance 58205, ok 72974, radius 17382, shape 1407 +- Design inputs: 100000, each a proposed design run through the model, the bounds, the gate and the objective +- Design edges: 88514 of the design inputs have a gene on or just past a bound, or a margin on or just past its limit +- Design verdicts: bounds 21702, budget 19676, distance 17684, ok 7116, radius 33263, worse 559 +- Loop inputs: 5000, each a whole run through `loop` and `changes`: 27628 proposals in all, 3602 taken up - Failures: 0 diff --git a/formal/tests/oracle.py b/formal/tests/oracle.py index a4afe21..d12f60c 100644 --- a/formal/tests/oracle.py +++ b/formal/tests/oracle.py @@ -1,10 +1,16 @@ -"""The exact plant gate in Python: the original the Lean gate is tested against. +"""The exact plant gate and plant model in Python: the original the Lean code is tested against. Integers only. `verify.py` at the repository root uses these same functions -to decide every step of the improvement loop, and then replays the recorded -decisions through the Lean executable. +to compute every margin and decide every step of the improvement loop, and +then replays the recorded decisions through the Lean executable. """ +GENES = ("pcm_kwh", "capture_ppm", "wall_u_mw", "floor_kw", "shed_ppm") +PLANT = ("p_it_w", "cop_ppm", "ua_roof_mw_k", "wall_area_m2", "dt_mk", "other_w", "passive_w", "aux_w", + "loop_cop_milli") +SCENARIO = ("outage_min", "outages_per_year", "low_demand_fraction_ppm", "low_demand_hours", "hours_per_year") +TOP = 10_000_000 # what a margin reads when its capacity is not positive, or its ratio is above ten + def dist_sq(base, cand): return sum((c - b) * (c - b) for b, c in zip(base, cand)) @@ -39,3 +45,129 @@ def evolve(limit, state, cand, cost): def line(mode, x, budget, cost, base, cand): """One input line for the Lean executable.""" return f"{mode} {x} {budget} {cost} ; {' '.join(map(str, base))} ; {' '.join(map(str, cand))}" + + +# ---------------------------------------------------------------- the plant model and the loop over designs +def ceil_div(a, b): + return (a + b - 1) // b + + +def ppm(num, den): + """Demand over capacity in parts per million, rounded up.""" + return TOP if den <= 0 else min(TOP, ceil_div(1_000_000 * num, den)) + + +def q_fix(p, g): + return (p["ua_roof_mw_k"] + g["wall_u_mw"] * p["wall_area_m2"]) * p["dt_mk"] + p["other_w"] * 1_000_000 + + +def drive_num(p, g): + return ((1_000_000 - g["capture_ppm"]) * (p["p_it_w"] * 1_000_000) + 1_000_000 * q_fix(p, g)) * 1_000_000 + + +def drive_den(p, g): + return p["cop_ppm"] * g["capture_ppm"] * (p["p_it_w"] * 1_000_000) + + +def cool_gain(p, g): + return (1_000_000 + p["cop_ppm"]) * g["capture_ppm"] - 1_000_000_000_000 + + +def floor_num(p, g): + return q_fix(p, g) * 1000 + + +def outage_num(p, sc, g): + return p["p_it_w"] * (1_000_000 - g["shed_ppm"]) * sc["outage_min"] + + +def outage_den(g): + return 60_000_000_000 * g["pcm_kwh"] + + +def moving_margins(p, sc, g): + gain = cool_gain(p, g) + floor = TOP if gain <= 0 or g["floor_kw"] <= 0 else ppm(floor_num(p, g), gain * g["floor_kw"]) + return [ppm(drive_num(p, g), drive_den(p, g)), floor, ppm(outage_num(p, sc, g), outage_den(g))] + + +def margins(p, sc, g): + return list(p["fixed"]) + moving_margins(p, sc, g) + + +def utility(p, x): + return x * p["loop_cop_milli"] + (x - p["passive_w"] * 1_000_000) * 1000 \ + + (p["aux_w"] + p["other_w"]) * 1_000_000 * p["loop_cop_milli"] + + +def objective(p, sc, g): + full = p["p_it_w"] * 1_000_000 + low = sc["low_demand_fraction_ppm"] * p["p_it_w"] + it_low = max(low, g["floor_kw"] * 1_000_000_000) + shed_p = g["shed_ppm"] * p["p_it_w"] + t_full = (sc["hours_per_year"] - sc["low_demand_hours"]) * 60 + t_low = sc["low_demand_hours"] * 60 + t_out = sc["outage_min"] * sc["outages_per_year"] + useful = full * t_full + low * t_low - shed_p * t_out + used = utility(p, full) * t_full + utility(p, it_low) * t_low - utility(p, shed_p) * t_out + return 0 if used <= 0 else (1_000_000 * useful * p["loop_cop_milli"]) // used + + +def in_bounds(lo, hi, g): + return all(lo[k] <= g[k] <= hi[k] for k in GENES) + + +def design_step(p, sc, limit, state, cand): + """One generation over designs. Returns the new state and the verdict.""" + held, budget = state + base = margins(p, sc, held) + verdict, remaining = gate(base, margins(p, sc, cand), headroom(limit, base), budget, 1) + if not in_bounds(p["lo"], p["hi"], cand): + name = "bounds" + elif verdict != "ok": + name = verdict + elif objective(p, sc, cand) < objective(p, sc, held): + name = "worse" + else: + name = "ok" + return ((cand, remaining) if name == "ok" else state), name + + +def _genes(g): + return " ".join(str(g[k]) for k in GENES) + + +def design_line(limit, budget, p, sc, held, cand): + """One input line for the Lean executable: a proposed design.""" + return " ; ".join([f"g {limit} {budget}", " ".join(str(p[k]) for k in PLANT), + " ".join(str(sc[k]) for k in SCENARIO), _genes(p["lo"]), _genes(p["hi"]), + " ".join(map(str, p["fixed"])), _genes(held), _genes(cand)]) + + +def design_expected(limit, budget, p, sc, held, cand): + """What the Lean executable must print for that line.""" + (_, after), name = design_step(p, sc, limit, (held, budget), cand) + return (f"{name} {after} {objective(p, sc, held)} {objective(p, sc, cand)} ; " + + " ".join(map(str, margins(p, sc, cand)))) + + +def run_designs(p, sc, limit, state, cands): + """A whole run: every proposed design in turn. Returns the final state and the number taken up.""" + taken = 0 + for cand in cands: + state, name = design_step(p, sc, limit, state, cand) + taken += name == "ok" + return state, taken + + +def loop_line(limit, budget, p, sc, start, cands): + """One input line for the Lean executable: a whole run through `loop` and `changes`.""" + return " ; ".join([f"l {limit} {budget}", " ".join(str(p[k]) for k in PLANT), + " ".join(str(sc[k]) for k in SCENARIO), _genes(p["lo"]), _genes(p["hi"]), + " ".join(map(str, p["fixed"])), _genes(start)] + [_genes(c) for c in cands]) + + +def loop_expected(limit, budget, p, sc, start, cands): + """What the Lean executable must print for that line: final design, budget left, designs taken up.""" + (held, left), taken = run_designs(p, sc, limit, (start, budget), cands) + return f"{_genes(held)} {left} {taken}" diff --git a/formal/tests/run_tests.py b/formal/tests/run_tests.py index d25143e..0421ab3 100644 --- a/formal/tests/run_tests.py +++ b/formal/tests/run_tests.py @@ -1,13 +1,18 @@ #!/usr/bin/env python3 """Differential tests: the Lean `plantgate` executable against the oracle. -The oracle is the exact Python gate in `tests/oracle.py`, the original the -Lean code stands in for. Inputs are edge cases, random cases from a recorded -seed, and mutations that put a candidate exactly on the radius, one unit -inside it and one unit outside it, and a cost exactly at, just under and -just over the budget. Run from anywhere: +The oracle is the exact Python gate and plant model in `tests/oracle.py`, +the original the Lean code stands in for. Gate inputs are edge cases, random +cases from a recorded seed, and mutations that put a candidate exactly on +the radius, one unit inside it and one unit outside it, and a cost exactly +at, just under and just over the budget. Design inputs are whole proposed +designs, run through the model, the bounds, the gate and the objective: +designs near the reference plant, designs with a gene exactly on a bound or +a margin exactly on its limit, and designs made of arbitrary integers. Loop +inputs are whole runs, a start design and up to twelve proposals, which go +through the proved `loop` and `changes`. Run from anywhere: - python3 tests/run_tests.py [--seed N] [--count N] + python3 tests/run_tests.py [--seed N] [--count N] [--designs N] [--loops N] It builds the executable if it is missing, writes `tests/TEST-RESULTS.md`, and exits non-zero if any input disagrees. @@ -36,6 +41,107 @@ def expected(case): return f"{verdict} {remaining}" +# A plant close to the reference campus. The tests perturb it; the real one is pinned by verify.py. +PLANT = dict(p_it_w=10_000_000, cop_ppm=620_000, ua_roof_mw_k=308_500, wall_area_m2=2476, dt_mk=20_000, + other_w=200_000, passive_w=377_600, aux_w=195_000, loop_cop_milli=28_000, + fixed=[179100, 563000, 387879, 588180, 176100, 801052, 616000, 607511, 300275, 496948, 769564], + lo=dict(pcm_kwh=500, capture_ppm=620_000, wall_u_mw=100, floor_kw=0, shed_ppm=0), + hi=dict(pcm_kwh=5000, capture_ppm=950_000, wall_u_mw=2400, floor_kw=10_000, shed_ppm=1_000_000)) +YEAR = dict(outage_min=20, outages_per_year=12, low_demand_fraction_ppm=30_000, low_demand_hours=2000, + hours_per_year=8760) +NUDGE = dict(pcm_kwh=100, capture_ppm=5000, wall_u_mw=4, floor_kw=20, shed_ppm=25_000) + + +def design_inputs(seed, count): + """Proposed designs: near the reference plant, on its edges, and arbitrary integers. + Returns the cases and how many sit on an edge.""" + rng = random.Random(seed + 1) + cases, edges = [], 0 + + def push(limit, budget, plant, year, held, cand, edge=False): + nonlocal edges + if len(cases) < count: + cases.append((limit, budget, plant, year, held, cand)) + edges += edge + + def signed(bits): + return rng.getrandbits(bits) - (1 << (bits - 1)) + + while len(cases) < count: + budget = rng.choice([0, 1, 2, 64]) + limit = rng.choice([1_000_000, 1_000_000, 950_000]) + if rng.random() < 0.7: + plant = dict(PLANT) + if rng.random() < 0.3: # another plant of the same kind + plant["cop_ppm"] = rng.randint(400_000, 900_000) + plant["other_w"] = rng.randint(0, 600_000) + plant["fixed"] = [rng.randint(0, 1_050_000) for _ in range(rng.randint(0, 12))] + lo, hi = plant["lo"], plant["hi"] + held = {k: rng.randint(lo[k], hi[k]) for k in oracle.GENES} + if rng.random() < 0.6: # a design that is likely to be within its limits + held.update(pcm_kwh=rng.randint(2400, 5000), capture_ppm=rng.randint(800_000, 950_000), + floor_kw=rng.randint(450, 900), shed_ppm=rng.randint(0, 400_000)) + gene = rng.choice(oracle.GENES) + cand = dict(held) + cand[gene] += rng.choice([1, -1]) * rng.choice([1, NUDGE[gene], 8 * NUDGE[gene]]) + push(limit, budget, plant, YEAR, held, cand) + for edge in (lo[gene] - 1, lo[gene], hi[gene], hi[gene] + 1): # a gene on and past a bound + push(limit, budget, plant, YEAR, held, dict(held, **{gene: edge}), True) + gain = oracle.cool_gain(plant, held) + if gain > 0: # the scheduler's floor exactly at, just above and just below the plant's + at = oracle.ceil_div(oracle.floor_num(plant, held), gain) + for f in (at - 1, at, at + 1): + push(limit, budget, plant, YEAR, held, dict(held, floor_kw=f), True) + need = oracle.ceil_div(oracle.outage_num(plant, YEAR, held), 60_000_000_000) + for store in (need - 1, need, need + 1): # the store exactly at, above and below one outage + push(limit, budget, plant, YEAR, held, dict(held, pcm_kwh=store), True) + push(limit, budget, plant, YEAR, held, dict(held), True) # no change at all + else: # arbitrary integers: every function is total + bits = rng.choice([3, 12, 24, 45]) + plant = {k: signed(bits) for k in oracle.PLANT} + plant["fixed"] = [signed(bits) for _ in range(rng.randint(0, 4))] + plant["lo"] = {k: signed(bits) for k in oracle.GENES} + plant["hi"] = {k: plant["lo"][k] + rng.getrandbits(bits) for k in oracle.GENES} + year = {k: signed(bits) for k in oracle.SCENARIO} + held = {k: signed(bits) for k in oracle.GENES} + cand = {k: held[k] + rng.choice([0, 0, 1, -1, signed(bits // 2 + 1)]) for k in oracle.GENES} + push(rng.choice([limit, signed(bits)]), rng.choice([budget, signed(bits)]), plant, year, held, cand) + return cases, edges + + +def loop_inputs(seed, count): + """Whole runs: a start design and up to twelve proposals, near the reference plant or arbitrary.""" + rng = random.Random(seed + 2) + cases = [] + while len(cases) < count: + budget = rng.choice([0, 1, 2, 3, 64]) + limit = rng.choice([1_000_000, 1_000_000, 950_000]) + if rng.random() < 0.85: + plant, year = dict(PLANT), YEAR + start = dict(pcm_kwh=rng.randint(2400, 5000), capture_ppm=rng.randint(800_000, 950_000), + wall_u_mw=rng.randint(100, 400), floor_kw=rng.randint(450, 900), shed_ppm=rng.randint(0, 400_000)) + cands, held = [], dict(start) + for _ in range(rng.randint(0, 12)): + cand = dict(held) + for gene in rng.sample(oracle.GENES, rng.randint(0, 3)): # none at all is a proposal too + cand[gene] += rng.choice([1, -1]) * rng.choice([1, NUDGE[gene], 3 * NUDGE[gene]]) + cands.append(cand) + if rng.random() < 0.7: + held = cand # the proposer assumes it was taken up, which may be wrong + else: + bits = rng.choice([3, 12, 24]) + signed = lambda: rng.getrandbits(bits) - (1 << (bits - 1)) + plant = {k: signed() for k in oracle.PLANT} + plant["fixed"] = [signed() for _ in range(rng.randint(0, 3))] + plant["lo"] = {k: signed() for k in oracle.GENES} + plant["hi"] = {k: plant["lo"][k] + rng.getrandbits(bits) for k in oracle.GENES} + year = {k: signed() for k in oracle.SCENARIO} + start = {k: signed() for k in oracle.GENES} + cands = [{k: start[k] + rng.choice([0, 1, -1, signed()]) for k in oracle.GENES} for _ in range(rng.randint(0, 6))] + cases.append((limit, budget, plant, year, start, cands)) + return cases + + def inputs(seed, count): """Edge cases, then random cases, each followed by its mutations. Returns the cases and how many of them are mutations.""" @@ -97,22 +203,32 @@ def main(): ap = argparse.ArgumentParser() ap.add_argument("--seed", type=int, default=20261117) ap.add_argument("--count", type=int, default=300_000) + ap.add_argument("--designs", type=int, default=100_000) + ap.add_argument("--loops", type=int, default=5_000) args = ap.parse_args() if not EXE.exists(): subprocess.run(["lake", "build", "plantgate"], cwd=ROOT, check=True) cases, mutated = inputs(args.seed, args.count) - stdin = "".join(oracle.line(*c) + "\n" for c in cases) + designs, edges = design_inputs(args.seed, args.designs) + loops = loop_inputs(args.seed, args.loops) + stdin = "".join(oracle.line(*c) + "\n" for c in cases) + "".join(oracle.design_line(*d) + "\n" for d in designs) \ + + "".join(oracle.loop_line(*r) + "\n" for r in loops) out = subprocess.run([str(EXE)], input=stdin, capture_output=True, text=True, check=True).stdout.split("\n") - failures = [(c, got) for c, got in zip(cases, out) if got != expected(c)] - if len(out) < len(cases): + want = [expected(c) for c in cases] + [oracle.design_expected(*d) for d in designs] \ + + [oracle.loop_expected(*r) for r in loops] + failures = [(c, got) for c, w, got in zip(cases + designs + loops, want, out) if got != w] + if len(out) < len(want): failures.append(("missing output", f"{len(out)} lines")) - verdicts = {} - for c in cases: - v = expected(c).split()[0] - verdicts[v] = verdicts.get(v, 0) + 1 + verdicts, design_verdicts = {}, {} + for w in want[:len(cases)]: + verdicts[w.split()[0]] = verdicts.get(w.split()[0], 0) + 1 + for w in want[len(cases):len(cases) + len(designs)]: + design_verdicts[w.split()[0]] = design_verdicts.get(w.split()[0], 0) + 1 + proposals = sum(len(r[5]) for r in loops) + taken = sum(int(w.split()[-1]) for w in want[len(cases) + len(designs):]) lean = subprocess.run(["lake", "env", "lean", "--version"], cwd=ROOT, capture_output=True, text=True).stdout.strip() @@ -121,12 +237,17 @@ def main(): "", "Written by `tests/run_tests.py`. Rerun it to check these numbers.", "", - f"- Oracle: Python {platform.python_version()} exact gate in `tests/oracle.py`", + f"- Oracle: Python {platform.python_version()} exact gate and plant model in `tests/oracle.py`", f"- Lean: {lean}", f"- Seed: {args.seed}", - f"- Inputs: {len(cases)}", - f"- Mutated: {mutated} of the inputs sit on, just inside or just outside a radius, a limit or a length", + f"- Inputs: {len(want)}", + f"- Gate inputs: {len(cases)}", + f"- Mutated: {mutated} of the gate inputs sit on, just inside or just outside a radius, a limit or a length", "- Verdicts: " + ", ".join(f"{k} {v}" for k, v in sorted(verdicts.items())), + f"- Design inputs: {len(designs)}, each a proposed design run through the model, the bounds, the gate and the objective", + f"- Design edges: {edges} of the design inputs have a gene on or just past a bound, or a margin on or just past its limit", + "- Design verdicts: " + ", ".join(f"{k} {v}" for k, v in sorted(design_verdicts.items())), + f"- Loop inputs: {len(loops)}, each a whole run through `loop` and `changes`: {proposals} proposals in all, {taken} taken up", f"- Failures: {len(failures)}", "", ] @@ -135,7 +256,7 @@ def main(): lines += [f"- `{c}`: Lean printed `{got}`" for c, got in failures[:50]] lines.append("") RESULTS.write_text("\n".join(lines)) - print(f"{len(cases) - len(failures)}/{len(cases)} inputs agree; " + print(f"{len(want) - len(failures)}/{len(want)} inputs agree; " f"results in {RESULTS}") return 1 if failures else 0 diff --git a/loop.py b/loop.py index 57bf1a2..adec9e3 100644 --- a/loop.py +++ b/loop.py @@ -1,22 +1,26 @@ #!/usr/bin/env python3 """The improvement loop: hardware and software of the campus changed together, one gated step at a time. -A genome holds three hardware genes (thermal store size, liquid capture fraction, wall U-value), two -software genes (the scheduler's load floor and the share of load it sheds in a cooling outage) and one -gene of the proposer itself (its step scale). Each generation the proposer suggests changes, the plant -model turns each candidate into a vector of margins, and the exact gate in formal/ decides. Hardware -changes are scored by the headroom they open, software changes by the objective they gain. An admitted -candidate becomes the baseline of the next generation. Every decision goes into a hash-chained ledger. - -What is proved (in Lean, formal/): no list of proposals can push a margin past its limit or overdraw -the change budget through the gate. What is not: the plant model, the objective, the proposer and this -file. The scenario is a choice made here, so the efficiency figures are illustrations, not predictions. +A design holds three hardware genes (thermal store size, liquid capture fraction, wall U-value) and two +software genes (the scheduler's load floor and the share of load it sheds in a cooling outage). The +proposer adds one gene of its own, its step scale. Each generation something proposes a design. The plant +model turns it into a vector of margins and an objective, and one step function decides: the design must +lie within the bounds, pass the gate, and not lower the objective. A design that is taken up becomes the +one held. Every decision goes into a hash-chained ledger. + +The model, the bounds, the gate, the objective and the step are exact integer arithmetic, written twice: +in Lean (formal/PlantGate.lean), where the properties of the loop are proved for every list of proposals, +and in Python (formal/tests/oracle.py), which this file calls and which is tested against the Lean +executable. What is not proved: that the model describes a real plant, and the proposers. The scenario +is a choice made here, so the efficiency figures are illustrations, not predictions. + +Two proposers use the loop. `run_loop` is a seeded search. `run_proposals` replays a recorded list of +proposals made by anything else: a person, a model, an adversary. """ from __future__ import annotations import hashlib import json -import math import sys from pathlib import Path @@ -33,52 +37,68 @@ BOUNDS = {"pcm_kwh": (500, 5000), "capture_ppm": (620000, 950000), "wall_u_mw": (100, 2400), "floor_kw": (0, 10000), "shed_ppm": (0, 1000000), "step_ppm": (125000, 8000000)} -# The scenario the objective is scored on. These four numbers are choices made here. -SCENARIO = {"outage_min": 20, "outages_per_year": 12, "low_demand_fraction_ppm": 30000, "low_demand_hours": 2000} +MOVING = ("sorption_drive_heat", "load_floor", "outage_ride_through") # the margins the genes move +# The scenario the objective is scored on. The first four numbers are choices made here. +SCENARIO = {"outage_min": 20, "outages_per_year": 12, "low_demand_fraction_ppm": 30000, "low_demand_hours": 2000, + "hours_per_year": 8760} -def model(genome: dict, plant: dict) -> dict: - """Margins (ppm of limit) and the objective for one genome. `plant` holds the pinned upstream values.""" - p_kw = plant["p_it_kw"] - alpha = genome["capture_ppm"] / 1e6 - cop = plant["cop_ads"] - q_env_kw = (plant["ua_roof_w_k"] + genome["wall_u_mw"] / 1000.0 * plant["wall_area_m2"]) * plant["design_dt_k"] / 1000.0 - q_fix_kw = q_env_kw + plant["other_kw"] - denom = (1.0 + cop) * alpha - 1.0 - p_min_kw = math.inf if denom <= 0 else q_fix_kw / denom - shed = genome["shed_ppm"] / 1e6 - outage_h = SCENARIO["outage_min"] / 60.0 - - def ppm(x: float) -> int: # rounded up, so a margin is never understated - return 10 * LIMIT if not math.isfinite(x) else min(10 * LIMIT, math.ceil(x * 1e6 - 1e-9)) - - moving = { - "sorption_drive_heat": ppm(((1.0 - alpha) * p_kw + q_fix_kw) / cop / (alpha * p_kw)), - "load_floor": ppm(p_min_kw / genome["floor_kw"]) if genome["floor_kw"] > 0 else 10 * LIMIT, - "outage_ride_through": ppm(p_kw * (1.0 - shed) * outage_h / genome["pcm_kwh"]), - } - margins = dict(plant["fixed_margins_ppm"]) - margins.update(moving) - # Objective: useful IT energy delivered per unit of utility energy over the scenario year. - hours, low_h = 8760.0, SCENARIO["low_demand_hours"] - low_kw = SCENARIO["low_demand_fraction_ppm"] / 1e6 * p_kw - it_low = max(low_kw, genome["floor_kw"]) # the scheduler fills up to its floor; the filler is not useful - lost = shed * p_kw * outage_h * SCENARIO["outages_per_year"] - useful = p_kw * (hours - low_h) + low_kw * low_h - lost +def genes(genome: dict) -> dict: + """The design part of a genome: the five genes the model reads.""" + return {k: genome[k] for k in oracle.GENES} - def utility(it_kw: float) -> float: # the upstream plant model: cooling loop, auxiliaries, other overhead - return it_kw + (it_kw - plant["passive_kw"]) / plant["loop_cop"] + plant["aux_kw"] + plant["other_kw"] - used = utility(p_kw) * (hours - low_h) + utility(it_low) * low_h - utility(shed * p_kw) * outage_h * SCENARIO["outages_per_year"] - return {"margins": margins, "names": list(margins), "vector": list(margins.values()), - "eta_ppm": math.floor(useful / used * 1e6), "p_min_kw": round(p_min_kw, 1)} +def model(genome: dict, plant: dict) -> dict: + """Margins (ppm of limit) and the objective for one design, from the exact model.""" + vector = oracle.margins(plant, SCENARIO, genes(genome)) + names = list(plant["fixed_names"]) + list(MOVING) + return {"margins": dict(zip(names, vector)), "names": names, "vector": vector, + "eta_ppm": oracle.objective(plant, SCENARIO, genes(genome))} def digest(entry: dict) -> str: return hashlib.sha256(json.dumps(entry, sort_keys=True, separators=(",", ":")).encode()).hexdigest() +def decide(plant: dict, held: dict, budget: int, cand: dict, prev: str, **extra) -> dict: + """One decision of the step function, as a ledger entry.""" + base, m = model(held, plant), model(cand, plant) + (_, after), verdict = oracle.design_step(plant, SCENARIO, LIMIT, (genes(held), budget), genes(cand)) + entry = {**extra, "held": genes(held), "proposed": genes(cand), "base_ppm": base["vector"], "cand_ppm": m["vector"], + "radius_ppm": oracle.headroom(LIMIT, base["vector"]), "eta_before_ppm": base["eta_ppm"], + "eta_after_ppm": m["eta_ppm"], "budget_before": budget, "cost": 1, "verdict": verdict, + "budget_after": after, "prev": prev} + entry["hash"] = digest(entry) + return entry + + +def head_of(plant: dict, start: dict, budget: int, **extra) -> dict: + base = model(start, plant) + return {"start_genome": dict(start), "start_margins_ppm": base["margins"], "start_eta_ppm": base["eta_ppm"], + "budget": budget, "limit": LIMIT, "scenario": SCENARIO, "plant": plant, **extra} + + +def run_proposals(plant: dict, start: dict, budget: int, proposals: list[dict]) -> dict: + """Replay a recorded list of proposals, whoever made them. Each proposal sets one or more genes.""" + genome = genes(start) + ledger, prev = [], "0" * 64 + for turn, prop in enumerate(proposals): + cand = dict(genome) + cand.update({k: int(v) for k, v in prop["set"].items() if k in oracle.GENES}) + kinds = sorted({"hardware" if k in HARDWARE else "software" for k in prop["set"] if cand[k] != genome[k]}) + entry = decide(plant, genome, budget, cand, prev, turn=turn, kind="+".join(kinds) or "none", + set={k: cand[k] for k in prop["set"] if k in oracle.GENES}) + ledger.append(entry) + prev = entry["hash"] + if entry["verdict"] == "ok": + genome, budget = cand, entry["budget_after"] + final = model(genome, plant) + return {"head": head_of(plant, genes(start), budget if not ledger else ledger[0]["budget_before"]), + "entries": ledger, "final_genome": genome, "final_margins_ppm": final["margins"], + "final_eta_ppm": final["eta_ppm"], "final_budget": budget, "final_hash": prev} + + def run_loop(plant: dict, start: dict, budget: int, generations: int = 400, seed: int = 20261117) -> dict: """Run the loop and return the ledger. Deterministic for a given seed.""" state = seed @@ -91,8 +111,7 @@ def rnd() -> float: genome = dict(start) base = model(genome, plant) ledger, prev = [], "0" * 64 - head = {"start_genome": dict(genome), "start_margins_ppm": base["margins"], "start_eta_ppm": base["eta_ppm"], - "budget": budget, "limit": LIMIT, "scenario": SCENARIO, "seed": seed} + head = head_of(plant, genome, budget, seed=seed) idle = 0 for gen in range(generations): if budget <= 0 or idle >= 40: @@ -122,14 +141,11 @@ def rnd() -> float: genome["step_ppm"] = max(BOUNDS["step_ppm"][0], genome["step_ppm"] // 2) # nothing better: look closer continue cand, m, gene, delta, _ = best - radius = oracle.headroom(LIMIT, base["vector"]) - verdict, remaining = oracle.gate(base["vector"], m["vector"], radius, budget, 1) - entry = {"generation": gen, "gene": gene, "kind": "hardware" if gene in HARDWARE else "software", - "delta": delta, "step_ppm": genome["step_ppm"], "base_ppm": base["vector"], "cand_ppm": m["vector"], - "radius_ppm": radius, "eta_before_ppm": base["eta_ppm"], "eta_after_ppm": m["eta_ppm"], - "budget_before": budget, "cost": 1, "verdict": verdict, "budget_after": remaining, "prev": prev} - entry["hash"] = prev = digest(entry) + entry = decide(plant, genome, budget, cand, prev, generation=gen, gene=gene, + kind="hardware" if gene in HARDWARE else "software", delta=delta, step_ppm=genome["step_ppm"]) + prev = entry["hash"] ledger.append(entry) + verdict, remaining = entry["verdict"], entry["budget_after"] if verdict == "ok": step = min(BOUNDS["step_ppm"][1], genome["step_ppm"] * 2) # it worked: reach further next time genome, base, budget, idle = dict(cand), m, remaining, 0 @@ -153,11 +169,44 @@ def check_chain(ledger: dict) -> bool: def replay_lines(ledger: dict) -> list[str]: - """One line per ledger decision, for the Lean executable to decide again.""" - return [oracle.line("h", ledger["head"]["limit"], e["budget_before"], e["cost"], e["base_ppm"], e["cand_ppm"]) + """One line per ledger decision, for the Lean executable to work out again from the two designs.""" + h = ledger["head"] + return [oracle.design_line(h["limit"], e["budget_before"], h["plant"], h["scenario"], e["held"], e["proposed"]) for e in ledger["entries"]] +def replay_expected(ledger: dict) -> list[str]: + """What Lean must print for each line: verdict, budget left, both objectives and the proposed margins.""" + return [f"{e['verdict']} {e['budget_after']} {e['eta_before_ppm']} {e['eta_after_ppm']} ; " + + " ".join(map(str, e["cand_ppm"])) for e in ledger["entries"]] + + +def replay_whole(ledger: dict) -> tuple[str, str]: + """The whole run as one line for the Lean executable, and what `loop` and `changes` must print for it.""" + h = ledger["head"] + line = oracle.loop_line(h["limit"], h["budget"], h["plant"], h["scenario"], genes(h["start_genome"]), + [e["proposed"] for e in ledger["entries"]]) + taken = sum(1 for e in ledger["entries"] if e["verdict"] == "ok") + final = " ".join(str(ledger["final_genome"][k]) for k in oracle.GENES) + return line, f"{final} {ledger['final_budget']} {taken}" + + +def check_continuity(ledger: dict) -> bool: + """Each entry starts from the outcome of the one before, and the run starts within its limits and bounds.""" + h = ledger["head"] + held, budget = genes(h["start_genome"]), h["budget"] + if max(h["start_margins_ppm"].values()) > h["limit"] or not oracle.in_bounds(h["plant"]["lo"], h["plant"]["hi"], held): + return False + for e in ledger["entries"]: + if e["held"] != held or e["budget_before"] != budget: + return False + if e["verdict"] == "ok": + held, budget = e["proposed"], e["budget_after"] + elif e["budget_after"] != budget: + return False + return held == genes(ledger["final_genome"]) and budget == ledger["final_budget"] + + def summary(ledger: dict) -> dict: ok = [e for e in ledger["entries"] if e["verdict"] == "ok"] refused: dict[str, int] = {} @@ -169,11 +218,13 @@ def summary(ledger: dict) -> dict: "decisions": len(ledger["entries"]), "admitted": len(ok), "refused": dict(sorted(refused.items())), "admitted_hardware_changes": sum(1 for e in ok if e["kind"] == "hardware"), "admitted_software_changes": sum(1 for e in ok if e["kind"] == "software"), + "admitted_changes_to_both_at_once": sum(1 for e in ok if e["kind"] == "hardware+software"), "budget_start": ledger["head"]["budget"], "budget_left": ledger["final_budget"], "eta_start_ppm": ledger["head"]["start_eta_ppm"], "eta_final_ppm": ledger["final_eta_ppm"], "eta_never_fell": all(e["eta_after_ppm"] >= e["eta_before_ppm"] for e in ok), "worst_margin_ever_admitted_ppm": worst, "every_admitted_state_within_limit": worst <= LIMIT, "start_genome": ledger["head"]["start_genome"], "final_genome": ledger["final_genome"], - "largest_step_scale_ppm": max([e["step_ppm"] for e in ledger["entries"]], default=0), - "chain_intact": check_chain(ledger), "final_hash": ledger["final_hash"], + "largest_step_scale_ppm": max([e.get("step_ppm", 0) for e in ledger["entries"]], default=0), + "chain_intact": check_chain(ledger), "entries_follow_from_one_another": check_continuity(ledger), + "final_hash": ledger["final_hash"], } diff --git a/results/certificate.json b/results/certificate.json index d8233a8..c529912 100644 --- a/results/certificate.json +++ b/results/certificate.json @@ -1,6 +1,6 @@ { "repository": "aska-physical/optifab", - "version": "0.2.0", + "version": "0.3.0", "inputs": { "vendored": { "aska-physical/funi-frame/certificate.json": "92e7bbcea389274d2967e463ec3881ec9311db7786c5e74559defcd936dfb9fa", @@ -13,7 +13,7 @@ "pins.json": "acb6db126f4fdf3901c6f9f64a9b2d03ee4edc48ec863ccfb170d14604e96d54", "graph.json": "3c0a2dd368a0f223c6aea43b621e131461037425001eb6bceaa7742b25034966", "sources.json": "0ec0cfd7d8aa05ab7a51fb77ac8e91fb06dc44ce66ee6333ed965f7368ecc2d6", - "unit.json": "c2cb8e74da3ecb9c18ede97c00d5b1f1c65a9238dc5865d6aff751073ea96f4a", + "unit.json": "a2d74c05ec334e8dc49c0f802d539dd545762dbed08bf89eac273dd23a9342fd", "upstream/MANIFEST.json": "9dd0e7efbb39fb37bc542f86751becb3a6dc46fd348737e2b040a24598238541" }, "pinned_repositories": 36, @@ -378,7 +378,8 @@ "outage_min": 20, "outages_per_year": 12, "low_demand_fraction_ppm": 30000, - "low_demand_hours": 2000 + "low_demand_hours": 2000, + "hours_per_year": 8760 }, "limit_ppm": 1000000, "proposer_reserve_ppm": 950000, @@ -404,6 +405,7 @@ }, "admitted_hardware_changes": 30, "admitted_software_changes": 15, + "admitted_changes_to_both_at_once": 0, "budget_start": 64, "budget_left": 19, "eta_start_ppm": 914228, @@ -429,7 +431,8 @@ }, "largest_step_scale_ppm": 8000000, "chain_intact": true, - "final_hash": "20e492cea1606034f0e6917df14ccb774a219c00748fae8104429939cfbc9532", + "entries_follow_from_one_another": true, + "final_hash": "c60e31d13303a1605f91d1d19ab8800af07d211d5402e7baedd9a992997bd5fd", "final_margins_ppm": { "rack_vibration": 179100, "storey_drift": 563000, @@ -487,6 +490,261 @@ } } }, + "network_first_look": { + "assumption": "A-4: the chiller keeps its design share of the reversible COP at every recooling temperature", + "share_of_reversible_cop_at_design": 0.3022, + "sites": [ + { + "recooling_C": 30.0, + "sorption_cop": 0.62, + "load_floor_MW": 0.564, + "load_floor_share_of_nameplate": 0.056, + "cools_itself_at_some_load": true + }, + { + "recooling_C": 34.0, + "sorption_cop": 0.399, + "load_floor_MW": 1.127, + "load_floor_share_of_nameplate": 0.113, + "cools_itself_at_some_load": true + }, + { + "recooling_C": 36.0, + "sorption_cop": 0.325, + "load_floor_MW": 1.687, + "load_floor_share_of_nameplate": 0.169, + "cools_itself_at_some_load": true + }, + { + "recooling_C": 38.0, + "sorption_cop": 0.266, + "load_floor_MW": 2.804, + "load_floor_share_of_nameplate": 0.28, + "cools_itself_at_some_load": true + }, + { + "recooling_C": 40.0, + "sorption_cop": 0.217, + "load_floor_MW": 6.113, + "load_floor_share_of_nameplate": 0.611, + "cools_itself_at_some_load": true + }, + { + "recooling_C": 41.0, + "sorption_cop": 0.196, + "load_floor_MW": null, + "load_floor_share_of_nameplate": null, + "cools_itself_at_some_load": false + } + ], + "two_campuses": { + "recooling_C": [ + 30.0, + 38.0 + ], + "load_floors_MW": [ + 0.564, + 2.804 + ], + "network_load_floor_MW": 3.368, + "network_load_floor_share_of_nameplate": 0.168, + "warm_floor_over_cool_floor": 4.97 + }, + "utility_MW_per_MW_of_IT_load_at_every_site": 1.0357, + "placement_between_campuses_changes_energy_use": false + }, + "adversarial_proposer": { + "proposals": 3006, + "seed": 20261117, + "verdicts": { + "bounds": 55, + "budget": 1604, + "distance": 1278, + "ok": 64, + "worse": 5 + }, + "first_six_verdicts": [ + "bounds", + "bounds", + "distance", + "distance", + "worse", + "distance" + ], + "taken_up": 64, + "budget": 64, + "budget_left": 0, + "eta_start_ppm": 914228, + "eta_final_ppm": 914737, + "every_design_held_within_limit": true, + "every_design_held_within_bounds": true, + "objective_never_fell": true, + "changes_within_budget": true, + "chain_intact": true, + "entries_follow_from_one_another": true, + "final_hash": "89472e8ab980432bdd53f6be57b25d7414f77c802f5089f7b7a7f3a9bf144d85" + }, + "recorded_proposer": { + "present": true, + "proposer": "A language model (Claude, Anthropic) run as a sub-agent of the session that prepared this version. It was given the output of tools/propose.py and nothing else, and was told not to read the repository. That instruction was not enforced.", + "run_file": "results/model_run.json", + "turns_allowed": 40, + "proposals": 11, + "every_proposal_has_a_reason": true, + "admitted": 10, + "refused": { + "worse": 1 + }, + "admitted_hardware_changes": 4, + "admitted_software_changes": 2, + "admitted_changes_to_both_at_once": 4, + "budget_start": 64, + "budget_left": 54, + "eta_start_ppm": 914228, + "eta_final_ppm": 919548, + "worst_margin_ever_admitted_ppm": 999215, + "final_genome": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 392, + "shed_ppm": 0 + }, + "chain_intact": true, + "entries_follow_from_one_another": true, + "final_hash": "df96817f0e5e056b5c510312b895ed061ef20de99771a3d26447509d00fd1337", + "every_design_held_within_limit": true, + "every_design_held_within_bounds": true, + "objective_never_fell": true, + "changes_within_budget": true, + "final_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 120734, + "load_floor": 999215, + "outage_ride_through": 666667 + }, + "best_objective_found_by_direct_search": { + "objective_ppm": 919548, + "design": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 392, + "shed_ppm": 0 + } + }, + "share_of_the_possible_gain_reached": 1.0, + "against_the_seeded_search": { + "seeded": { + "proposals": 50, + "changes": 45, + "eta_final_ppm": 919009, + "share_of_the_possible_gain_reached": 0.8987 + }, + "recorded": { + "proposals": 11, + "changes": 10, + "eta_final_ppm": 919548, + "share_of_the_possible_gain_reached": 1.0 + } + }, + "edited_proposal_changes_the_ledger": true + }, + "recorded_proposer_given_lessons": { + "present": true, + "proposer": "A language model (Claude, Anthropic) run as a second sub-agent of the session that prepared this version, with no memory of the first run. It was given the output of tools/propose.py and the notes the first proposer left in results/model_lessons.md, and was told not to read anything else in the repository. That instruction was not enforced.", + "run_file": "results/model_run_2.json", + "lessons_file": "results/model_lessons.md", + "turns_allowed": 40, + "proposals": 4, + "every_proposal_has_a_reason": true, + "admitted": 4, + "refused": {}, + "admitted_hardware_changes": 0, + "admitted_software_changes": 1, + "admitted_changes_to_both_at_once": 3, + "budget_start": 64, + "budget_left": 60, + "eta_start_ppm": 914228, + "eta_final_ppm": 919548, + "worst_margin_ever_admitted_ppm": 999215, + "final_genome": { + "pcm_kwh": 3800, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 392, + "shed_ppm": 0 + }, + "chain_intact": true, + "entries_follow_from_one_another": true, + "final_hash": "280bf4d6d94659e3b2327f090e981942b0b430e969feee1be11b9b09e11f129f", + "every_design_held_within_limit": true, + "every_design_held_within_bounds": true, + "objective_never_fell": true, + "changes_within_budget": true, + "final_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 120734, + "load_floor": 999215, + "outage_ride_through": 877193 + }, + "best_objective_found_by_direct_search": { + "objective_ppm": 919548, + "design": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 392, + "shed_ppm": 0 + } + }, + "share_of_the_possible_gain_reached": 1.0, + "against_the_seeded_search": { + "seeded": { + "proposals": 50, + "changes": 45, + "eta_final_ppm": 919009, + "share_of_the_possible_gain_reached": 0.8987 + }, + "recorded": { + "proposals": 4, + "changes": 4, + "eta_final_ppm": 919548, + "share_of_the_possible_gain_reached": 1.0 + } + }, + "edited_proposal_changes_the_ledger": true, + "against_the_first_run": { + "objective_both_runs_reached_ppm": 919548, + "proposals_needed_first_run": 11, + "proposals_needed_with_lessons": 4, + "refused_first_run": 1, + "refused_with_lessons": 0, + "eta_final_first_run_ppm": 919548, + "eta_final_with_lessons_ppm": 919548, + "lessons_file_sha256": "e594d138237f9530171bb123bb956961878f6378e7dd26760e57ca44f6b98c21" + } + }, "formal": { "present": true, "lean": "Lean (version 4.35.0, x86_64-unknown-linux-gnu, commit eb6cafb7290e8bd5f2937522d8d804f58f02bafc, Release)", @@ -498,7 +756,14 @@ "PlantGate.Spec.no_margin_rises_past_radius", "PlantGate.Spec.accepted_stays_within", "PlantGate.Spec.run_safe", - "PlantGate.Spec.run_bounded" + "PlantGate.Spec.run_bounded", + "PlantGate.Spec.step_complete", + "PlantGate.Spec.step_refusal_changes_nothing", + "PlantGate.Spec.loop_safe", + "PlantGate.Spec.loop_in_bounds", + "PlantGate.Spec.loop_never_worse", + "PlantGate.Spec.loop_bounded", + "PlantGate.Spec.loop_keeps_physics" ], "comparator": { "command": "lake comparator --paranoid", @@ -513,17 +778,40 @@ ] }, "replay": { - "decisions": 50, - "mismatches": 0 + "decisions": 3071, + "mismatches": 0, + "by_ledger": { + "seeded_search": { + "decisions": 50, + "mismatches": 0, + "whole_run_through_lean_loop_agrees": true + }, + "adversary": { + "decisions": 3006, + "mismatches": 0, + "whole_run_through_lean_loop_agrees": true + }, + "recorded_proposer": { + "decisions": 11, + "mismatches": 0, + "whole_run_through_lean_loop_agrees": true + }, + "recorded_proposer_given_lessons": { + "decisions": 4, + "mismatches": 0, + "whole_run_through_lean_loop_agrees": true + } + } }, "differential_tests": { - "inputs": 300000, + "inputs": 405000, "seed": 20261117, "failures": 0, "passed": true }, "bar": "Proven Commons bar check: items 2 to 6 pass; item 1 is open (no reviewer has approved the specification). See formal/BAR-REPORT.md.", "matches_current_lean_sources": true, + "matches_current_ledgers": true, "matches_current_ledger": true }, "loop_timing": { @@ -829,7 +1117,11 @@ "must_fail_21_loop_makes_more_changes_than_its_budget": true, "must_fail_22_design_with_a_margin_at_its_limit_can_still_change": true, "must_fail_23_edited_ledger_entry_keeps_the_chain": true, - "must_fail_24_formal_record_is_stale_or_missing": true + "must_fail_24_formal_record_is_stale_or_missing": true, + "must_fail_25_adversary_moves_the_design_out_of_its_envelope": true, + "must_fail_26_recorded_run_of_an_outside_proposer_breaks_a_rule_or_can_be_edited_unseen": true, + "must_fail_28_ledger_whose_entries_do_not_follow_from_one_another_passes": true, + "must_fail_27_warm_site_campus_counted_with_the_design_load_floor": true }, - "controls_passed": "24/24" + "controls_passed": "28/28" } diff --git a/results/formal.json b/results/formal.json index 36b2ce6..15a7d1a 100644 --- a/results/formal.json +++ b/results/formal.json @@ -9,7 +9,14 @@ "PlantGate.Spec.no_margin_rises_past_radius", "PlantGate.Spec.accepted_stays_within", "PlantGate.Spec.run_safe", - "PlantGate.Spec.run_bounded" + "PlantGate.Spec.run_bounded", + "PlantGate.Spec.step_complete", + "PlantGate.Spec.step_refusal_changes_nothing", + "PlantGate.Spec.loop_safe", + "PlantGate.Spec.loop_in_bounds", + "PlantGate.Spec.loop_never_worse", + "PlantGate.Spec.loop_bounded", + "PlantGate.Spec.loop_keeps_physics" ], "comparator": { "command": "lake comparator --paranoid", @@ -24,16 +31,43 @@ ] }, "differential_tests": { - "inputs": 300000, + "inputs": 405000, "seed": 20261117, "failures": 0, "passed": true }, "replay": { - "decisions": 50, - "mismatches": 0 + "decisions": 3071, + "mismatches": 0, + "by_ledger": { + "seeded_search": { + "decisions": 50, + "mismatches": 0, + "whole_run_through_lean_loop_agrees": true + }, + "adversary": { + "decisions": 3006, + "mismatches": 0, + "whole_run_through_lean_loop_agrees": true + }, + "recorded_proposer": { + "decisions": 11, + "mismatches": 0, + "whole_run_through_lean_loop_agrees": true + }, + "recorded_proposer_given_lessons": { + "decisions": 4, + "mismatches": 0, + "whole_run_through_lean_loop_agrees": true + } + } }, "bar": "Proven Commons bar check: items 2 to 6 pass; item 1 is open (no reviewer has approved the specification). See formal/BAR-REPORT.md.", - "sources_sha256": "dc427e448abf0d8d54a7a06e1f93ec408b520a93c6dd122c5c0b24fcf9db8d53", - "ledger_hash": "20e492cea1606034f0e6917df14ccb774a219c00748fae8104429939cfbc9532" + "sources_sha256": "bf0f2fc31d705011583e2598d8074ed2a531db1c2fca1f2e2627d581bc225507", + "ledger_hashes": { + "seeded_search": "c60e31d13303a1605f91d1d19ab8800af07d211d5402e7baedd9a992997bd5fd", + "adversary": "89472e8ab980432bdd53f6be57b25d7414f77c802f5089f7b7a7f3a9bf144d85", + "recorded_proposer": "df96817f0e5e056b5c510312b895ed061ef20de99771a3d26447509d00fd1337", + "recorded_proposer_given_lessons": "280bf4d6d94659e3b2327f090e981942b0b430e969feee1be11b9b09e11f129f" + } } diff --git a/results/ledger.json b/results/ledger.json index 0e769b1..c09d2f9 100644 --- a/results/ledger.json +++ b/results/ledger.json @@ -31,7 +31,59 @@ "outage_min": 20, "outages_per_year": 12, "low_demand_fraction_ppm": 30000, - "low_demand_hours": 2000 + "low_demand_hours": 2000, + "hours_per_year": 8760 + }, + "plant": { + "p_it_w": 10000000, + "cop_ppm": 620000, + "ua_roof_mw_k": 308500, + "wall_area_m2": 2476, + "dt_mk": 20000, + "other_w": 200000, + "passive_w": 377600, + "aux_w": 195000, + "loop_cop_milli": 28000, + "fixed": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564 + ], + "fixed_names": [ + "rack_vibration", + "storey_drift", + "roof_crown_compression", + "roof_tornado_uplift_factored", + "roof_service_deflection_mm", + "floor_punching_collar", + "floor_walking_vibration", + "floor_crown_compression", + "floor_fire_120min_thrust", + "floor_duct_hole_shear", + "sensor_power_at_airflow_turndown" + ], + "lo": { + "pcm_kwh": 500, + "capture_ppm": 620000, + "wall_u_mw": 100, + "floor_kw": 0, + "shed_ppm": 0 + }, + "hi": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 2400, + "floor_kw": 10000, + "shed_ppm": 1000000 + } }, "seed": 20261117 }, @@ -42,6 +94,20 @@ "kind": "hardware", "delta": 2500, "step_ppm": 500000, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 852500, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, "base_ppm": [ 179100, 563000, @@ -82,7 +148,7 @@ "verdict": "ok", "budget_after": 63, "prev": "0000000000000000000000000000000000000000000000000000000000000000", - "hash": "441d2da3e81c6777264d463c7d22a8ef9d9dff50a49e1dd5302045718d15281b" + "hash": "5a6489450fab931ee4a2696cfd5bf7d0f863f794643dcefaff7c1d28d14d3978" }, { "generation": 4, @@ -90,6 +156,20 @@ "kind": "software", "delta": -5, "step_ppm": 250000, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 852500, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 852500, + "wall_u_mw": 132, + "floor_kw": 595, + "shed_ppm": 300000 + }, "base_ppm": [ 179100, 563000, @@ -129,8 +209,8 @@ "cost": 1, "verdict": "ok", "budget_after": 62, - "prev": "441d2da3e81c6777264d463c7d22a8ef9d9dff50a49e1dd5302045718d15281b", - "hash": "1a56e7cc2d76e26f2cd3939e3cb7a2b2ed73e5ba4af631169af30fda0c8eac37" + "prev": "5a6489450fab931ee4a2696cfd5bf7d0f863f794643dcefaff7c1d28d14d3978", + "hash": "9da71fcdae3bed3578e0f616f1e3e57cca29d2d1d68cec9e61a0c4998271ac7e" }, { "generation": 5, @@ -138,6 +218,20 @@ "kind": "hardware", "delta": 2500, "step_ppm": 500000, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 852500, + "wall_u_mw": 132, + "floor_kw": 595, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 855000, + "wall_u_mw": 132, + "floor_kw": 595, + "shed_ppm": 300000 + }, "base_ppm": [ 179100, 563000, @@ -177,8 +271,8 @@ "cost": 1, "verdict": "ok", "budget_after": 61, - "prev": "1a56e7cc2d76e26f2cd3939e3cb7a2b2ed73e5ba4af631169af30fda0c8eac37", - "hash": "0bad3a3aec0f415c6a7cf9d2ca90769c2b792c336cba573009c716b0df77da66" + "prev": "9da71fcdae3bed3578e0f616f1e3e57cca29d2d1d68cec9e61a0c4998271ac7e", + "hash": "e3c2cab37fc4bfbed2b60eb7885893b641a6e3c9bc277042d1933cde52c96a36" }, { "generation": 8, @@ -186,6 +280,20 @@ "kind": "software", "delta": -5, "step_ppm": 250000, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 855000, + "wall_u_mw": 132, + "floor_kw": 595, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 855000, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 300000 + }, "base_ppm": [ 179100, 563000, @@ -225,8 +333,8 @@ "cost": 1, "verdict": "ok", "budget_after": 60, - "prev": "0bad3a3aec0f415c6a7cf9d2ca90769c2b792c336cba573009c716b0df77da66", - "hash": "368365f2a4ec6b5f0bbfb5aa358e18fb0c1c13641cf01faeaed737c83f3cf618" + "prev": "e3c2cab37fc4bfbed2b60eb7885893b641a6e3c9bc277042d1933cde52c96a36", + "hash": "01342dbf4819c55e58a2c6973b28c1b09d714e1ddeea34d740739ebf5dc9039d" }, { "generation": 9, @@ -234,6 +342,20 @@ "kind": "hardware", "delta": 2500, "step_ppm": 500000, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 855000, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 857500, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 300000 + }, "base_ppm": [ 179100, 563000, @@ -273,8 +395,8 @@ "cost": 1, "verdict": "ok", "budget_after": 59, - "prev": "368365f2a4ec6b5f0bbfb5aa358e18fb0c1c13641cf01faeaed737c83f3cf618", - "hash": "41282de1ab9fd11341711155a687565c013294e983dcaaecdf47b58fead6b90a" + "prev": "01342dbf4819c55e58a2c6973b28c1b09d714e1ddeea34d740739ebf5dc9039d", + "hash": "a91dbc85258fd55d5edb10ec6aa63f27ae0368a6d709c9e7c54b54d94eabfbe2" }, { "generation": 12, @@ -282,6 +404,20 @@ "kind": "software", "delta": -6250, "step_ppm": 250000, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 857500, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 857500, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -321,8 +457,8 @@ "cost": 1, "verdict": "ok", "budget_after": 58, - "prev": "41282de1ab9fd11341711155a687565c013294e983dcaaecdf47b58fead6b90a", - "hash": "05ad892137d3aa28db10cd3fa96485cf0236ac6f98bebc0ff15d8b6c96b4e587" + "prev": "a91dbc85258fd55d5edb10ec6aa63f27ae0368a6d709c9e7c54b54d94eabfbe2", + "hash": "0a1aeede2d7d317b314af10b055be51d7881af83296235f3f02f3d087a776e09" }, { "generation": 13, @@ -330,6 +466,20 @@ "kind": "hardware", "delta": 50, "step_ppm": 500000, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 857500, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2550, + "capture_ppm": 857500, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -369,8 +519,8 @@ "cost": 1, "verdict": "ok", "budget_after": 57, - "prev": "05ad892137d3aa28db10cd3fa96485cf0236ac6f98bebc0ff15d8b6c96b4e587", - "hash": "cf32e2ae4393882a698b5a3dfda4508543a30d815b6db31a7b68f99c629b3dc7" + "prev": "0a1aeede2d7d317b314af10b055be51d7881af83296235f3f02f3d087a776e09", + "hash": "b1ea16008da23490842d28a16406aee3ea00f3f015cabd93fbf820b6e2ce6b59" }, { "generation": 15, @@ -378,6 +528,20 @@ "kind": "hardware", "delta": 2500, "step_ppm": 500000, + "held": { + "pcm_kwh": 2550, + "capture_ppm": 857500, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2550, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -417,8 +581,8 @@ "cost": 1, "verdict": "ok", "budget_after": 56, - "prev": "cf32e2ae4393882a698b5a3dfda4508543a30d815b6db31a7b68f99c629b3dc7", - "hash": "e940a4a62ef2efbf80fbe9427a84da2f5b8f1efad29dfe8e51dc599492c3091f" + "prev": "b1ea16008da23490842d28a16406aee3ea00f3f015cabd93fbf820b6e2ce6b59", + "hash": "68e274a6a4d95dcdf0f7204c465924a1d55ab27b321f553e4bc01840c4faf13d" }, { "generation": 16, @@ -426,6 +590,20 @@ "kind": "software", "delta": -20, "step_ppm": 1000000, + "held": { + "pcm_kwh": 2550, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 590, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2550, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 570, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -465,8 +643,8 @@ "cost": 1, "verdict": "ok", "budget_after": 55, - "prev": "e940a4a62ef2efbf80fbe9427a84da2f5b8f1efad29dfe8e51dc599492c3091f", - "hash": "9677377895e8ccf5c77688dd069b90e75172697729439690df1dcf8d5ea9ff61" + "prev": "68e274a6a4d95dcdf0f7204c465924a1d55ab27b321f553e4bc01840c4faf13d", + "hash": "d915f2670bec969e44c3606bc5b1580d942f10e707197b8dfe3bb9227e0dc164" }, { "generation": 17, @@ -474,6 +652,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2550, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 570, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2550, + "capture_ppm": 870000, + "wall_u_mw": 132, + "floor_kw": 570, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -513,8 +705,8 @@ "cost": 1, "verdict": "ok", "budget_after": 54, - "prev": "9677377895e8ccf5c77688dd069b90e75172697729439690df1dcf8d5ea9ff61", - "hash": "1927a67c84e161e6b158d72398b1caa8ca29e718e03ad5f6979c91d4ace0715a" + "prev": "d915f2670bec969e44c3606bc5b1580d942f10e707197b8dfe3bb9227e0dc164", + "hash": "e4a73960b1c53bb3f31b5affa722d810605c1ffaab219e7ea3567f2c1d12d857" }, { "generation": 19, @@ -522,6 +714,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2550, + "capture_ppm": 870000, + "wall_u_mw": 132, + "floor_kw": 570, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2750, + "capture_ppm": 870000, + "wall_u_mw": 132, + "floor_kw": 570, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -561,8 +767,8 @@ "cost": 1, "verdict": "ok", "budget_after": 53, - "prev": "1927a67c84e161e6b158d72398b1caa8ca29e718e03ad5f6979c91d4ace0715a", - "hash": "a2f36abc4996ab5a0f25427f4aa589b1864bae2966372fb2c43c229794c448e9" + "prev": "e4a73960b1c53bb3f31b5affa722d810605c1ffaab219e7ea3567f2c1d12d857", + "hash": "44d7d149b33e59f7f6aaa880b7d9b02fcd11e516911f63dc758c907ea8a8e5be" }, { "generation": 21, @@ -570,6 +776,20 @@ "kind": "hardware", "delta": -8, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2750, + "capture_ppm": 870000, + "wall_u_mw": 132, + "floor_kw": 570, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2750, + "capture_ppm": 870000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -609,8 +829,8 @@ "cost": 1, "verdict": "ok", "budget_after": 52, - "prev": "a2f36abc4996ab5a0f25427f4aa589b1864bae2966372fb2c43c229794c448e9", - "hash": "363d059846a476f9eb78053c8d249e70c63edd3c76e3f3f6cede42409491c754" + "prev": "44d7d149b33e59f7f6aaa880b7d9b02fcd11e516911f63dc758c907ea8a8e5be", + "hash": "dbbb989130ff874cc17653a75cc37daabaaef1caee9b0614003c2e2ef77b30d5" }, { "generation": 23, @@ -618,6 +838,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2750, + "capture_ppm": 870000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2750, + "capture_ppm": 880000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -657,8 +891,8 @@ "cost": 1, "verdict": "ok", "budget_after": 51, - "prev": "363d059846a476f9eb78053c8d249e70c63edd3c76e3f3f6cede42409491c754", - "hash": "fa3f56287f53ad565c5e0a5d69dcc5d044651b148371307a47ae52aa9a205e9a" + "prev": "dbbb989130ff874cc17653a75cc37daabaaef1caee9b0614003c2e2ef77b30d5", + "hash": "16aa25229e6c7b5d4939534ad2b8c70a01138aea6c9a3f90c5e6573b0eddd095" }, { "generation": 25, @@ -666,6 +900,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2750, + "capture_ppm": 880000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2750, + "capture_ppm": 890000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -705,8 +953,8 @@ "cost": 1, "verdict": "ok", "budget_after": 50, - "prev": "fa3f56287f53ad565c5e0a5d69dcc5d044651b148371307a47ae52aa9a205e9a", - "hash": "0b5e951863a11967a7724b27c01e9e9c2a2cfb53c2695d29e177b73fa4d89e88" + "prev": "16aa25229e6c7b5d4939534ad2b8c70a01138aea6c9a3f90c5e6573b0eddd095", + "hash": "80b025d1038cedeb51c60bf2f8c361eca5c4d282017c698addbf9c9513a9cd59" }, { "generation": 27, @@ -714,6 +962,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2750, + "capture_ppm": 890000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 890000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -753,8 +1015,8 @@ "cost": 1, "verdict": "ok", "budget_after": 49, - "prev": "0b5e951863a11967a7724b27c01e9e9c2a2cfb53c2695d29e177b73fa4d89e88", - "hash": "84ee31028ae19cf91ffadb101725551d52b5cf3fa1a39d8212d34beb52bf5a0f" + "prev": "80b025d1038cedeb51c60bf2f8c361eca5c4d282017c698addbf9c9513a9cd59", + "hash": "92e99d1f7a79e4671da83586918ab2722ea95763c587ad1477bab97c63fb76cf" }, { "generation": 29, @@ -762,6 +1024,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 890000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 900000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -801,8 +1077,8 @@ "cost": 1, "verdict": "ok", "budget_after": 48, - "prev": "84ee31028ae19cf91ffadb101725551d52b5cf3fa1a39d8212d34beb52bf5a0f", - "hash": "911b41d2e1d2c18bc943cf97df6d7a7a747cd57587e28a8a6b2ac4b4d57063f5" + "prev": "92e99d1f7a79e4671da83586918ab2722ea95763c587ad1477bab97c63fb76cf", + "hash": "60b162cff6e4fac458e719b7364d11b290c54164c27586c73e5262947ade1bb6" }, { "generation": 30, @@ -810,6 +1086,20 @@ "kind": "software", "delta": -80, "step_ppm": 4000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 900000, + "wall_u_mw": 124, + "floor_kw": 570, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 900000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -849,8 +1139,8 @@ "cost": 1, "verdict": "ok", "budget_after": 47, - "prev": "911b41d2e1d2c18bc943cf97df6d7a7a747cd57587e28a8a6b2ac4b4d57063f5", - "hash": "78ea4f3d631fac86f8668600dbf8d41ae2f2fce570728fd66c51009e607cef5e" + "prev": "60b162cff6e4fac458e719b7364d11b290c54164c27586c73e5262947ade1bb6", + "hash": "edcbf9dc9a0f2644c90f00bd1213424580ffcb3a7d67fe9bb7e76a0f7b93a1ce" }, { "generation": 31, @@ -858,6 +1148,20 @@ "kind": "hardware", "delta": 40000, "step_ppm": 8000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 900000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 940000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -897,8 +1201,8 @@ "cost": 1, "verdict": "distance", "budget_after": 47, - "prev": "78ea4f3d631fac86f8668600dbf8d41ae2f2fce570728fd66c51009e607cef5e", - "hash": "a805aacb6463b5d0e0d63faa605f66890c94fae1bbdb2f11d359402baac3f256" + "prev": "edcbf9dc9a0f2644c90f00bd1213424580ffcb3a7d67fe9bb7e76a0f7b93a1ce", + "hash": "89681a60dabcfb3d20f3fe9c70b7ce0a7ebbe4e092f4579e398bc7c27b217abb" }, { "generation": 32, @@ -906,6 +1210,20 @@ "kind": "software", "delta": -100000, "step_ppm": 4000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 900000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 900000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 193750 + }, "base_ppm": [ 179100, 563000, @@ -945,8 +1263,8 @@ "cost": 1, "verdict": "distance", "budget_after": 47, - "prev": "a805aacb6463b5d0e0d63faa605f66890c94fae1bbdb2f11d359402baac3f256", - "hash": "daabeedc74ee8bdae32fd8e8dbb4d7c0f67cd428a03a09917a8089b68717e393" + "prev": "89681a60dabcfb3d20f3fe9c70b7ce0a7ebbe4e092f4579e398bc7c27b217abb", + "hash": "7ea4271c859a587bc7b2d455d54856b71879fac5d2a7df7b06e71641da031a22" }, { "generation": 33, @@ -954,6 +1272,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 900000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 910000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -993,8 +1325,8 @@ "cost": 1, "verdict": "ok", "budget_after": 46, - "prev": "daabeedc74ee8bdae32fd8e8dbb4d7c0f67cd428a03a09917a8089b68717e393", - "hash": "29cf8ae111d7537037471537a54dd23a2c85f3d792d1d0d103ba9e82c4dda6b5" + "prev": "7ea4271c859a587bc7b2d455d54856b71879fac5d2a7df7b06e71641da031a22", + "hash": "70786d2b1303db2b29da20e82266132cdce5441d3ba59072b15e372e60b7635d" }, { "generation": 34, @@ -1002,6 +1334,20 @@ "kind": "software", "delta": -100000, "step_ppm": 4000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 910000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 910000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 193750 + }, "base_ppm": [ 179100, 563000, @@ -1041,8 +1387,8 @@ "cost": 1, "verdict": "distance", "budget_after": 46, - "prev": "29cf8ae111d7537037471537a54dd23a2c85f3d792d1d0d103ba9e82c4dda6b5", - "hash": "c3027fe0b3a19a4487a119f840d330af9a4e583248e46497c2aa02230f33b2b9" + "prev": "70786d2b1303db2b29da20e82266132cdce5441d3ba59072b15e372e60b7635d", + "hash": "9e750d258987c02e5c84a14bdc7e4003ed88262da223b7185722944bc9b7ec96" }, { "generation": 35, @@ -1050,6 +1396,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 910000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 920000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, "base_ppm": [ 179100, 563000, @@ -1089,8 +1449,8 @@ "cost": 1, "verdict": "ok", "budget_after": 45, - "prev": "c3027fe0b3a19a4487a119f840d330af9a4e583248e46497c2aa02230f33b2b9", - "hash": "ce63985c490eee54e3576c30033208ca2da6932531ea8efa6ad2f4345c7d4187" + "prev": "9e750d258987c02e5c84a14bdc7e4003ed88262da223b7185722944bc9b7ec96", + "hash": "5ddf29f25cce51a418bff7b1fca6935811edd7238f35355b288262374942d3c2" }, { "generation": 36, @@ -1098,6 +1458,20 @@ "kind": "software", "delta": -100000, "step_ppm": 4000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 920000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 293750 + }, + "proposed": { + "pcm_kwh": 2950, + "capture_ppm": 920000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 193750 + }, "base_ppm": [ 179100, 563000, @@ -1137,8 +1511,8 @@ "cost": 1, "verdict": "ok", "budget_after": 44, - "prev": "ce63985c490eee54e3576c30033208ca2da6932531ea8efa6ad2f4345c7d4187", - "hash": "1b5e95e9e409dbe172542813c153b8904f26f4e5db0830820266b8535cbac5ba" + "prev": "5ddf29f25cce51a418bff7b1fca6935811edd7238f35355b288262374942d3c2", + "hash": "95a628c4a147b20977f9f0df4a4074ac5b292cad2f8a38e0cd0d25372716992e" }, { "generation": 39, @@ -1146,6 +1520,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 2950, + "capture_ppm": 920000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 193750 + }, + "proposed": { + "pcm_kwh": 3150, + "capture_ppm": 920000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 193750 + }, "base_ppm": [ 179100, 563000, @@ -1185,8 +1573,8 @@ "cost": 1, "verdict": "ok", "budget_after": 43, - "prev": "1b5e95e9e409dbe172542813c153b8904f26f4e5db0830820266b8535cbac5ba", - "hash": "750e9b6364b4376691d6c8727d9acbea7740235a6c1e9aa8c2c7386b87c3293f" + "prev": "95a628c4a147b20977f9f0df4a4074ac5b292cad2f8a38e0cd0d25372716992e", + "hash": "3b7fee49fcb50712641f75faa335646c3e6935423c87bfbe121ca6dc2df4bf60" }, { "generation": 41, @@ -1194,6 +1582,20 @@ "kind": "hardware", "delta": -8, "step_ppm": 2000000, + "held": { + "pcm_kwh": 3150, + "capture_ppm": 920000, + "wall_u_mw": 124, + "floor_kw": 490, + "shed_ppm": 193750 + }, + "proposed": { + "pcm_kwh": 3150, + "capture_ppm": 920000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 193750 + }, "base_ppm": [ 179100, 563000, @@ -1233,8 +1635,8 @@ "cost": 1, "verdict": "ok", "budget_after": 42, - "prev": "750e9b6364b4376691d6c8727d9acbea7740235a6c1e9aa8c2c7386b87c3293f", - "hash": "d2b98dc4f66960c65831ea8b1546fc316a899d22690cd472e7f0124570d1e918" + "prev": "3b7fee49fcb50712641f75faa335646c3e6935423c87bfbe121ca6dc2df4bf60", + "hash": "0e963d9720a0e05cedb7e617441947a9103366533e93282b49f1d46069da2265" }, { "generation": 43, @@ -1242,6 +1644,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 3150, + "capture_ppm": 920000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 193750 + }, + "proposed": { + "pcm_kwh": 3150, + "capture_ppm": 930000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 193750 + }, "base_ppm": [ 179100, 563000, @@ -1281,8 +1697,8 @@ "cost": 1, "verdict": "ok", "budget_after": 41, - "prev": "d2b98dc4f66960c65831ea8b1546fc316a899d22690cd472e7f0124570d1e918", - "hash": "e6b731f9c95418e2d2d0684259a293594c634534a26cd60a0440003e5cbbcad0" + "prev": "0e963d9720a0e05cedb7e617441947a9103366533e93282b49f1d46069da2265", + "hash": "0d95b078809cf2b6ea2f42cdf149049380d1adce34c462fa1bf22104c79ab893" }, { "generation": 45, @@ -1290,6 +1706,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 3150, + "capture_ppm": 930000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 193750 + }, + "proposed": { + "pcm_kwh": 3150, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 193750 + }, "base_ppm": [ 179100, 563000, @@ -1329,8 +1759,8 @@ "cost": 1, "verdict": "ok", "budget_after": 40, - "prev": "e6b731f9c95418e2d2d0684259a293594c634534a26cd60a0440003e5cbbcad0", - "hash": "5a2d0058cf5f1721d361db3fac5a8993298639779d6dd99d3b20d202fc498abd" + "prev": "0d95b078809cf2b6ea2f42cdf149049380d1adce34c462fa1bf22104c79ab893", + "hash": "5331b0a2ce6d51938e8077afafa4eb05ade3af362b66a20338931c65e3a96d94" }, { "generation": 47, @@ -1338,6 +1768,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 3150, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 193750 + }, + "proposed": { + "pcm_kwh": 3350, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 193750 + }, "base_ppm": [ 179100, 563000, @@ -1377,8 +1821,8 @@ "cost": 1, "verdict": "ok", "budget_after": 39, - "prev": "5a2d0058cf5f1721d361db3fac5a8993298639779d6dd99d3b20d202fc498abd", - "hash": "cff409f12327160638a36ab26f8e8d5dbe7e73317d47740298c9973225664a59" + "prev": "5331b0a2ce6d51938e8077afafa4eb05ade3af362b66a20338931c65e3a96d94", + "hash": "abbc8b10ed4652188ce45269e6091368eb37d374d1394decb5f0c3ab85be78ca" }, { "generation": 48, @@ -1386,6 +1830,20 @@ "kind": "software", "delta": -100000, "step_ppm": 4000000, + "held": { + "pcm_kwh": 3350, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 193750 + }, + "proposed": { + "pcm_kwh": 3350, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 93750 + }, "base_ppm": [ 179100, 563000, @@ -1425,8 +1883,8 @@ "cost": 1, "verdict": "ok", "budget_after": 38, - "prev": "cff409f12327160638a36ab26f8e8d5dbe7e73317d47740298c9973225664a59", - "hash": "170a4b0ada5398d3e6b50eecb1f2c44dd77e509fdfff521fada5ce3eb670d940" + "prev": "abbc8b10ed4652188ce45269e6091368eb37d374d1394decb5f0c3ab85be78ca", + "hash": "735f13a785642f089f3a1b24f881c46f246b6f8e504f32d921265e0215575dcc" }, { "generation": 49, @@ -1434,6 +1892,20 @@ "kind": "hardware", "delta": 800, "step_ppm": 8000000, + "held": { + "pcm_kwh": 3350, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 93750 + }, + "proposed": { + "pcm_kwh": 4150, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 93750 + }, "base_ppm": [ 179100, 563000, @@ -1473,8 +1945,8 @@ "cost": 1, "verdict": "distance", "budget_after": 38, - "prev": "170a4b0ada5398d3e6b50eecb1f2c44dd77e509fdfff521fada5ce3eb670d940", - "hash": "e9965a195c7ca6855198b074e5378d98f570409498cdf359d2b6cb47b5e08e21" + "prev": "735f13a785642f089f3a1b24f881c46f246b6f8e504f32d921265e0215575dcc", + "hash": "ddc319267dc2a74686ef99ddeec283141356a0423b05144bea10da83d88c91a7" }, { "generation": 51, @@ -1482,6 +1954,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 3350, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 93750 + }, + "proposed": { + "pcm_kwh": 3550, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 93750 + }, "base_ppm": [ 179100, 563000, @@ -1521,8 +2007,8 @@ "cost": 1, "verdict": "ok", "budget_after": 37, - "prev": "e9965a195c7ca6855198b074e5378d98f570409498cdf359d2b6cb47b5e08e21", - "hash": "e2705b1576ac9e44a8b62f62e4b1f530df294eaa0289060793488eab145193d5" + "prev": "ddc319267dc2a74686ef99ddeec283141356a0423b05144bea10da83d88c91a7", + "hash": "a09c63b00cffe3687db6abd9f9ae118b774b3e3753ec353e9e2fd17369e8d3e4" }, { "generation": 52, @@ -1530,6 +2016,20 @@ "kind": "software", "delta": -93750, "step_ppm": 4000000, + "held": { + "pcm_kwh": 3550, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 93750 + }, + "proposed": { + "pcm_kwh": 3550, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1569,8 +2069,8 @@ "cost": 1, "verdict": "ok", "budget_after": 36, - "prev": "e2705b1576ac9e44a8b62f62e4b1f530df294eaa0289060793488eab145193d5", - "hash": "cf3792c5ba02641ece5577313a104ceae0cd55146487780c6ce2279b95348d37" + "prev": "a09c63b00cffe3687db6abd9f9ae118b774b3e3753ec353e9e2fd17369e8d3e4", + "hash": "cab096860b2f105d0b07e35e8b9128f27fa2b1d3a06a8e29aee9aba9605cb12b" }, { "generation": 53, @@ -1578,6 +2078,20 @@ "kind": "hardware", "delta": 800, "step_ppm": 8000000, + "held": { + "pcm_kwh": 3550, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1617,8 +2131,8 @@ "cost": 1, "verdict": "distance", "budget_after": 36, - "prev": "cf3792c5ba02641ece5577313a104ceae0cd55146487780c6ce2279b95348d37", - "hash": "7499cadafef44435e72df36bb32e518fbc26977b92d65f970d7b748592f3e823" + "prev": "cab096860b2f105d0b07e35e8b9128f27fa2b1d3a06a8e29aee9aba9605cb12b", + "hash": "bb67f3d69ff3cd24903d0a212b3df49aa45a3165a2ee4b387450332b72cc7b42" }, { "generation": 55, @@ -1626,6 +2140,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 3550, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 3750, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1665,8 +2193,8 @@ "cost": 1, "verdict": "ok", "budget_after": 35, - "prev": "7499cadafef44435e72df36bb32e518fbc26977b92d65f970d7b748592f3e823", - "hash": "effbbad2e20fe3afc0ea6561829d141b62930aed55bd0861081dd98d4d218127" + "prev": "bb67f3d69ff3cd24903d0a212b3df49aa45a3165a2ee4b387450332b72cc7b42", + "hash": "4244fe5562fefa37831975bd4b6f96300148942276e7eed7e5148c983051c23e" }, { "generation": 57, @@ -1674,6 +2202,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 3750, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 3950, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1713,8 +2255,8 @@ "cost": 1, "verdict": "ok", "budget_after": 34, - "prev": "effbbad2e20fe3afc0ea6561829d141b62930aed55bd0861081dd98d4d218127", - "hash": "19b5bb344fe9d2eba4900cbd404889e0892ffffd863efbe3d7479cac32d758ff" + "prev": "4244fe5562fefa37831975bd4b6f96300148942276e7eed7e5148c983051c23e", + "hash": "25774439e06796abb31d7854f85d5ee5a3589fbad910a0b71515c042d2dd117a" }, { "generation": 59, @@ -1722,6 +2264,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 3950, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4150, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1761,8 +2317,8 @@ "cost": 1, "verdict": "ok", "budget_after": 33, - "prev": "19b5bb344fe9d2eba4900cbd404889e0892ffffd863efbe3d7479cac32d758ff", - "hash": "f596597e13765af2b593c885c27fd29accf8e428792df3ddca754af58f2533a2" + "prev": "25774439e06796abb31d7854f85d5ee5a3589fbad910a0b71515c042d2dd117a", + "hash": "571685e3a31ca24da522de5b09255b3ab6b86466b7523f7f9baecde0d49f29b9" }, { "generation": 61, @@ -1770,6 +2326,20 @@ "kind": "hardware", "delta": 10000, "step_ppm": 2000000, + "held": { + "pcm_kwh": 4150, + "capture_ppm": 940000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4150, + "capture_ppm": 950000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1809,8 +2379,8 @@ "cost": 1, "verdict": "ok", "budget_after": 32, - "prev": "f596597e13765af2b593c885c27fd29accf8e428792df3ddca754af58f2533a2", - "hash": "5aa954bfee79b9fdf1e95db7460d172467b9721ea9e054e68a2154d36b0528dc" + "prev": "571685e3a31ca24da522de5b09255b3ab6b86466b7523f7f9baecde0d49f29b9", + "hash": "9c504de814547cc8f4979fea59e7ba77e84737599a675348ebacc6163a4dcdb2" }, { "generation": 63, @@ -1818,6 +2388,20 @@ "kind": "hardware", "delta": 200, "step_ppm": 2000000, + "held": { + "pcm_kwh": 4150, + "capture_ppm": 950000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1857,8 +2441,8 @@ "cost": 1, "verdict": "ok", "budget_after": 31, - "prev": "5aa954bfee79b9fdf1e95db7460d172467b9721ea9e054e68a2154d36b0528dc", - "hash": "944f37016b5c3e5887919b5b95237dd18acdb07e172ff0f93e93a9d6bb257400" + "prev": "9c504de814547cc8f4979fea59e7ba77e84737599a675348ebacc6163a4dcdb2", + "hash": "1c3a552810001dc2c1b867998cf4e393f02bc9c3e3967bca42be5a2f79796081" }, { "generation": 69, @@ -1866,6 +2450,20 @@ "kind": "hardware", "delta": -1, "step_ppm": 125000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 116, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 115, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1905,8 +2503,8 @@ "cost": 1, "verdict": "ok", "budget_after": 30, - "prev": "944f37016b5c3e5887919b5b95237dd18acdb07e172ff0f93e93a9d6bb257400", - "hash": "41d260b2e81a50268aa239a945728410fbe92963e008eafd85b4549e0b67da58" + "prev": "1c3a552810001dc2c1b867998cf4e393f02bc9c3e3967bca42be5a2f79796081", + "hash": "b582534f266bab8b1918b5688e26930fe8bcc7c3101ecc5122c40ab8e9719b47" }, { "generation": 71, @@ -1914,6 +2512,20 @@ "kind": "hardware", "delta": -1, "step_ppm": 125000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 115, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 114, + "floor_kw": 490, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -1953,8 +2565,8 @@ "cost": 1, "verdict": "ok", "budget_after": 29, - "prev": "41d260b2e81a50268aa239a945728410fbe92963e008eafd85b4549e0b67da58", - "hash": "536bc6cb357be12601f27e197d0ff9492e3b278751a37446d1cdb2fee491af37" + "prev": "b582534f266bab8b1918b5688e26930fe8bcc7c3101ecc5122c40ab8e9719b47", + "hash": "c20684d6169fc3bfa07cb79e150e41bc6a5e69fb97c2af5126d15f3506979121" }, { "generation": 72, @@ -1962,6 +2574,20 @@ "kind": "software", "delta": -5, "step_ppm": 250000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 114, + "floor_kw": 490, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 114, + "floor_kw": 485, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2001,8 +2627,8 @@ "cost": 1, "verdict": "ok", "budget_after": 28, - "prev": "536bc6cb357be12601f27e197d0ff9492e3b278751a37446d1cdb2fee491af37", - "hash": "c97f7e722cc27335210c1bf8275b62a557947a6e36c587f28214fd228a24e850" + "prev": "c20684d6169fc3bfa07cb79e150e41bc6a5e69fb97c2af5126d15f3506979121", + "hash": "7bfba299d3cacc8bbd82f6d84db9f9a787f0b31f947319d10ce3206c486d03a1" }, { "generation": 74, @@ -2010,6 +2636,20 @@ "kind": "software", "delta": -5, "step_ppm": 250000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 114, + "floor_kw": 485, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 114, + "floor_kw": 480, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2049,8 +2689,8 @@ "cost": 1, "verdict": "ok", "budget_after": 27, - "prev": "c97f7e722cc27335210c1bf8275b62a557947a6e36c587f28214fd228a24e850", - "hash": "d724e23800fb9ca8067c2994458f42802431eb17166ffd1a3e82f56792083dc5" + "prev": "7bfba299d3cacc8bbd82f6d84db9f9a787f0b31f947319d10ce3206c486d03a1", + "hash": "e6aa5e20eafdfbe91bfe070daf01c5aec085c908f30a542f24edb4a8d2e325ff" }, { "generation": 75, @@ -2058,6 +2698,20 @@ "kind": "hardware", "delta": -2, "step_ppm": 500000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 114, + "floor_kw": 480, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 112, + "floor_kw": 480, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2097,8 +2751,8 @@ "cost": 1, "verdict": "ok", "budget_after": 26, - "prev": "d724e23800fb9ca8067c2994458f42802431eb17166ffd1a3e82f56792083dc5", - "hash": "d219425b38c8277fbffa56b55d6131b56b6435155ff9895a64db831a6395a642" + "prev": "e6aa5e20eafdfbe91bfe070daf01c5aec085c908f30a542f24edb4a8d2e325ff", + "hash": "0825b8f3dee1301c8b95e77218652c779d63281e67350c90164d21182f4c7d6e" }, { "generation": 76, @@ -2106,6 +2760,20 @@ "kind": "software", "delta": -20, "step_ppm": 1000000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 112, + "floor_kw": 480, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 112, + "floor_kw": 460, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2145,8 +2813,8 @@ "cost": 1, "verdict": "ok", "budget_after": 25, - "prev": "d219425b38c8277fbffa56b55d6131b56b6435155ff9895a64db831a6395a642", - "hash": "afd62c47bce0e20dc74464343c010f65cbab6ebcbc48c1cf2fe8d983adb7a1bb" + "prev": "0825b8f3dee1301c8b95e77218652c779d63281e67350c90164d21182f4c7d6e", + "hash": "9c5882f81e42ee6e6fab534a963c64c4c554e5563f1c64b3d772fd01251a6bf7" }, { "generation": 78, @@ -2154,6 +2822,20 @@ "kind": "software", "delta": -20, "step_ppm": 1000000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 112, + "floor_kw": 460, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 112, + "floor_kw": 440, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2193,8 +2875,8 @@ "cost": 1, "verdict": "ok", "budget_after": 24, - "prev": "afd62c47bce0e20dc74464343c010f65cbab6ebcbc48c1cf2fe8d983adb7a1bb", - "hash": "d8745f4a8d9949a59f27cb36c657079f6cc00bea56b0bf1ca8353b7ff3f21ef6" + "prev": "9c5882f81e42ee6e6fab534a963c64c4c554e5563f1c64b3d772fd01251a6bf7", + "hash": "66287f90f8f041c5808bf8cc55eb15b3ca3216419863fc673406171686e9b102" }, { "generation": 79, @@ -2202,6 +2884,20 @@ "kind": "hardware", "delta": -8, "step_ppm": 2000000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 112, + "floor_kw": 440, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 104, + "floor_kw": 440, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2241,8 +2937,8 @@ "cost": 1, "verdict": "ok", "budget_after": 23, - "prev": "d8745f4a8d9949a59f27cb36c657079f6cc00bea56b0bf1ca8353b7ff3f21ef6", - "hash": "5ee63683affbacf99167a1d59d2404a4230bde4fd76bae88caa2dfc6e63e7943" + "prev": "66287f90f8f041c5808bf8cc55eb15b3ca3216419863fc673406171686e9b102", + "hash": "cf23ac7f209b44a5a5d84a0e2224ac12e880d4bd5f7041e7331e2b9a8f5a268e" }, { "generation": 81, @@ -2250,6 +2946,20 @@ "kind": "hardware", "delta": -4, "step_ppm": 2000000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 104, + "floor_kw": 440, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 440, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2289,8 +2999,8 @@ "cost": 1, "verdict": "ok", "budget_after": 22, - "prev": "5ee63683affbacf99167a1d59d2404a4230bde4fd76bae88caa2dfc6e63e7943", - "hash": "0d9e8c3c9123b03691f99ad288e5ad70675c610820d542d3dad1ad677773932f" + "prev": "cf23ac7f209b44a5a5d84a0e2224ac12e880d4bd5f7041e7331e2b9a8f5a268e", + "hash": "8a13eb2a71b75f76e3cbee6855028d262cc4a62fa517d0d37e99a9e69f7d86d5" }, { "generation": 84, @@ -2298,6 +3008,20 @@ "kind": "software", "delta": -20, "step_ppm": 1000000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 440, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 420, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2337,8 +3061,8 @@ "cost": 1, "verdict": "ok", "budget_after": 21, - "prev": "0d9e8c3c9123b03691f99ad288e5ad70675c610820d542d3dad1ad677773932f", - "hash": "c5b75f02fa5edb363cc05b350828a86e71b1b400d397aa0f34d46616a01ad78a" + "prev": "8a13eb2a71b75f76e3cbee6855028d262cc4a62fa517d0d37e99a9e69f7d86d5", + "hash": "1daacda9c79be55b2c7f955aaae5c47b4ca436efc916e39ef94b9d79ead2d490" }, { "generation": 88, @@ -2346,6 +3070,20 @@ "kind": "software", "delta": -5, "step_ppm": 250000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 420, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 415, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2385,8 +3123,8 @@ "cost": 1, "verdict": "ok", "budget_after": 20, - "prev": "c5b75f02fa5edb363cc05b350828a86e71b1b400d397aa0f34d46616a01ad78a", - "hash": "fff82c4431758678ea77bf1f95edd8a1101833d1110a3e0d4d30496708011dfb" + "prev": "1daacda9c79be55b2c7f955aaae5c47b4ca436efc916e39ef94b9d79ead2d490", + "hash": "b06cda5fce393f75013558f42a5f0347d2649129ead796b22b5856ee8589be46" }, { "generation": 92, @@ -2394,6 +3132,20 @@ "kind": "software", "delta": -2, "step_ppm": 125000, + "held": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 415, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 413, + "shed_ppm": 0 + }, "base_ppm": [ 179100, 563000, @@ -2433,8 +3185,8 @@ "cost": 1, "verdict": "ok", "budget_after": 19, - "prev": "fff82c4431758678ea77bf1f95edd8a1101833d1110a3e0d4d30496708011dfb", - "hash": "20e492cea1606034f0e6917df14ccb774a219c00748fae8104429939cfbc9532" + "prev": "b06cda5fce393f75013558f42a5f0347d2649129ead796b22b5856ee8589be46", + "hash": "c60e31d13303a1605f91d1d19ab8800af07d211d5402e7baedd9a992997bd5fd" } ], "final_genome": { @@ -2463,5 +3215,5 @@ }, "final_eta_ppm": 919009, "final_budget": 19, - "final_hash": "20e492cea1606034f0e6917df14ccb774a219c00748fae8104429939cfbc9532" + "final_hash": "c60e31d13303a1605f91d1d19ab8800af07d211d5402e7baedd9a992997bd5fd" } diff --git a/results/model_ledger.json b/results/model_ledger.json new file mode 100644 index 0000000..1a0d4e7 --- /dev/null +++ b/results/model_ledger.json @@ -0,0 +1,803 @@ +{ + "head": { + "start_genome": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "start_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 324992, + "load_floor": 940348, + "outage_ride_through": 933334 + }, + "start_eta_ppm": 914228, + "budget": 64, + "limit": 1000000, + "scenario": { + "outage_min": 20, + "outages_per_year": 12, + "low_demand_fraction_ppm": 30000, + "low_demand_hours": 2000, + "hours_per_year": 8760 + }, + "plant": { + "p_it_w": 10000000, + "cop_ppm": 620000, + "ua_roof_mw_k": 308500, + "wall_area_m2": 2476, + "dt_mk": 20000, + "other_w": 200000, + "passive_w": 377600, + "aux_w": 195000, + "loop_cop_milli": 28000, + "fixed": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564 + ], + "fixed_names": [ + "rack_vibration", + "storey_drift", + "roof_crown_compression", + "roof_tornado_uplift_factored", + "roof_service_deflection_mm", + "floor_punching_collar", + "floor_walking_vibration", + "floor_crown_compression", + "floor_fire_120min_thrust", + "floor_duct_hole_shear", + "sensor_power_at_airflow_turndown" + ], + "lo": { + "pcm_kwh": 500, + "capture_ppm": 620000, + "wall_u_mw": 100, + "floor_kw": 0, + "shed_ppm": 0 + }, + "hi": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 2400, + "floor_kw": 10000, + "shed_ppm": 1000000 + } + } + }, + "entries": [ + { + "turn": 0, + "kind": "hardware", + "set": { + "capture_ppm": 860000 + }, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 324992, + 940348, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 901605, + 933334 + ], + "radius_ppm": 59652, + "eta_before_ppm": 914228, + "eta_after_ppm": 914228, + "budget_before": 64, + "cost": 1, + "verdict": "ok", + "budget_after": 63, + "prev": "0000000000000000000000000000000000000000000000000000000000000000", + "hash": "44b1ebc46468243893567cc48bcfb2c1f20bda4a5754ce54fab96515a74ac8c2" + }, + { + "turn": 1, + "kind": "software", + "set": { + "floor_kw": 580 + }, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 580, + "shed_ppm": 300000 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 901605, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 932695, + 933334 + ], + "radius_ppm": 66666, + "eta_before_ppm": 914228, + "eta_after_ppm": 914737, + "budget_before": 63, + "cost": 1, + "verdict": "ok", + "budget_after": 62, + "prev": "44b1ebc46468243893567cc48bcfb2c1f20bda4a5754ce54fab96515a74ac8c2", + "hash": "5d9270e2870a930ac51b22aa6ad2c1310a93eca615e90548a9cf82be4e513fd9" + }, + { + "turn": 2, + "kind": "software", + "set": { + "shed_ppm": 340000 + }, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 580, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2500, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 580, + "shed_ppm": 340000 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 932695, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 932695, + 880000 + ], + "radius_ppm": 66666, + "eta_before_ppm": 914737, + "eta_after_ppm": 914735, + "budget_before": 62, + "cost": 1, + "verdict": "worse", + "budget_after": 62, + "prev": "5d9270e2870a930ac51b22aa6ad2c1310a93eca615e90548a9cf82be4e513fd9", + "hash": "f20064d28b5597e4014545d60cea1e98a29d1f6347c707c762fe196b8468cb50" + }, + { + "turn": 3, + "kind": "hardware", + "set": { + "pcm_kwh": 2650 + }, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 580, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2650, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 580, + "shed_ppm": 300000 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 932695, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 932695, + 880504 + ], + "radius_ppm": 66666, + "eta_before_ppm": 914737, + "eta_after_ppm": 914737, + "budget_before": 62, + "cost": 1, + "verdict": "ok", + "budget_after": 61, + "prev": "f20064d28b5597e4014545d60cea1e98a29d1f6347c707c762fe196b8468cb50", + "hash": "235d140643bc49537f923cca0f570a6163c3fa5f626c75d6750d349935efa926" + }, + { + "turn": 4, + "kind": "hardware", + "set": { + "wall_u_mw": 150 + }, + "held": { + "pcm_kwh": 2650, + "capture_ppm": 860000, + "wall_u_mw": 132, + "floor_kw": 580, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2650, + "capture_ppm": 860000, + "wall_u_mw": 150, + "floor_kw": 580, + "shed_ppm": 300000 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 932695, + 880504 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302626, + 936604, + 880504 + ], + "radius_ppm": 67305, + "eta_before_ppm": 914737, + "eta_after_ppm": 914737, + "budget_before": 61, + "cost": 1, + "verdict": "ok", + "budget_after": 60, + "prev": "235d140643bc49537f923cca0f570a6163c3fa5f626c75d6750d349935efa926", + "hash": "4e5dcf9886812fdbda1c604cc3d9292f01cceb5c166c54696f3dbae9e08d1e09" + }, + { + "turn": 5, + "kind": "hardware+software", + "set": { + "capture_ppm": 880000, + "wall_u_mw": 100, + "floor_kw": 555 + }, + "held": { + "pcm_kwh": 2650, + "capture_ppm": 860000, + "wall_u_mw": 150, + "floor_kw": 580, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 2650, + "capture_ppm": 880000, + "wall_u_mw": 100, + "floor_kw": 555, + "shed_ppm": 300000 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302626, + 936604, + 880504 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 258637, + 893797, + 880504 + ], + "radius_ppm": 63396, + "eta_before_ppm": 914737, + "eta_after_ppm": 915372, + "budget_before": 60, + "cost": 1, + "verdict": "ok", + "budget_after": 59, + "prev": "4e5dcf9886812fdbda1c604cc3d9292f01cceb5c166c54696f3dbae9e08d1e09", + "hash": "062b75755553a81ef10122b5f3d798e43f2ebd7b36c91db14cceabbfbe57fdaf" + }, + { + "turn": 6, + "kind": "hardware+software", + "set": { + "shed_ppm": 0, + "pcm_kwh": 4200 + }, + "held": { + "pcm_kwh": 2650, + "capture_ppm": 880000, + "wall_u_mw": 100, + "floor_kw": 555, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 4200, + "capture_ppm": 880000, + "wall_u_mw": 100, + "floor_kw": 555, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 258637, + 893797, + 880504 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 258637, + 893797, + 793651 + ], + "radius_ppm": 106203, + "eta_before_ppm": 915372, + "eta_after_ppm": 915381, + "budget_before": 59, + "cost": 1, + "verdict": "ok", + "budget_after": 58, + "prev": "062b75755553a81ef10122b5f3d798e43f2ebd7b36c91db14cceabbfbe57fdaf", + "hash": "934e8011506abaeedffd192a9a518b630f09a17f9892518073a0d208b73cc37c" + }, + { + "turn": 7, + "kind": "hardware+software", + "set": { + "capture_ppm": 925000, + "floor_kw": 500 + }, + "held": { + "pcm_kwh": 4200, + "capture_ppm": 880000, + "wall_u_mw": 100, + "floor_kw": 555, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4200, + "capture_ppm": 925000, + "wall_u_mw": 100, + "floor_kw": 500, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 258637, + 893797, + 793651 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 167589, + 847030, + 793651 + ], + "radius_ppm": 106203, + "eta_before_ppm": 915381, + "eta_after_ppm": 916783, + "budget_before": 58, + "cost": 1, + "verdict": "ok", + "budget_after": 57, + "prev": "934e8011506abaeedffd192a9a518b630f09a17f9892518073a0d208b73cc37c", + "hash": "08cbb77f48e243288e5e0617560be0e7fab92de6934226a2a90facc3aecbab89" + }, + { + "turn": 8, + "kind": "hardware+software", + "set": { + "capture_ppm": 950000, + "floor_kw": 450 + }, + "held": { + "pcm_kwh": 4200, + "capture_ppm": 925000, + "wall_u_mw": 100, + "floor_kw": 500, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 4200, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 450, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 167589, + 847030, + 793651 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 870427, + 793651 + ], + "radius_ppm": 152970, + "eta_before_ppm": 916783, + "eta_after_ppm": 918061, + "budget_before": 57, + "cost": 1, + "verdict": "ok", + "budget_after": 56, + "prev": "08cbb77f48e243288e5e0617560be0e7fab92de6934226a2a90facc3aecbab89", + "hash": "eed9a062e98fdcede1ef97371a49165ae3200abb5b520a04996022b45e8888ff" + }, + { + "turn": 9, + "kind": "hardware", + "set": { + "pcm_kwh": 5000 + }, + "held": { + "pcm_kwh": 4200, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 450, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 450, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 870427, + 793651 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 870427, + 666667 + ], + "radius_ppm": 129573, + "eta_before_ppm": 918061, + "eta_after_ppm": 918061, + "budget_before": 56, + "cost": 1, + "verdict": "ok", + "budget_after": 55, + "prev": "eed9a062e98fdcede1ef97371a49165ae3200abb5b520a04996022b45e8888ff", + "hash": "784c37a311ab75e482b11c58cde6796cc58784f28f33472ff76d823e37a2dd2f" + }, + { + "turn": 10, + "kind": "software", + "set": { + "floor_kw": 392 + }, + "held": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 450, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 392, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 870427, + 666667 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 999215, + 666667 + ], + "radius_ppm": 129573, + "eta_before_ppm": 918061, + "eta_after_ppm": 919548, + "budget_before": 55, + "cost": 1, + "verdict": "ok", + "budget_after": 54, + "prev": "784c37a311ab75e482b11c58cde6796cc58784f28f33472ff76d823e37a2dd2f", + "hash": "df96817f0e5e056b5c510312b895ed061ef20de99771a3d26447509d00fd1337" + } + ], + "final_genome": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 392, + "shed_ppm": 0 + }, + "final_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 120734, + "load_floor": 999215, + "outage_ride_through": 666667 + }, + "final_eta_ppm": 919548, + "final_budget": 54, + "final_hash": "df96817f0e5e056b5c510312b895ed061ef20de99771a3d26447509d00fd1337" +} diff --git a/results/model_ledger_2.json b/results/model_ledger_2.json new file mode 100644 index 0000000..93df5ea --- /dev/null +++ b/results/model_ledger_2.json @@ -0,0 +1,371 @@ +{ + "head": { + "start_genome": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "start_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 324992, + "load_floor": 940348, + "outage_ride_through": 933334 + }, + "start_eta_ppm": 914228, + "budget": 64, + "limit": 1000000, + "scenario": { + "outage_min": 20, + "outages_per_year": 12, + "low_demand_fraction_ppm": 30000, + "low_demand_hours": 2000, + "hours_per_year": 8760 + }, + "plant": { + "p_it_w": 10000000, + "cop_ppm": 620000, + "ua_roof_mw_k": 308500, + "wall_area_m2": 2476, + "dt_mk": 20000, + "other_w": 200000, + "passive_w": 377600, + "aux_w": 195000, + "loop_cop_milli": 28000, + "fixed": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564 + ], + "fixed_names": [ + "rack_vibration", + "storey_drift", + "roof_crown_compression", + "roof_tornado_uplift_factored", + "roof_service_deflection_mm", + "floor_punching_collar", + "floor_walking_vibration", + "floor_crown_compression", + "floor_fire_120min_thrust", + "floor_duct_hole_shear", + "sensor_power_at_airflow_turndown" + ], + "lo": { + "pcm_kwh": 500, + "capture_ppm": 620000, + "wall_u_mw": 100, + "floor_kw": 0, + "shed_ppm": 0 + }, + "hi": { + "pcm_kwh": 5000, + "capture_ppm": 950000, + "wall_u_mw": 2400, + "floor_kw": 10000, + "shed_ppm": 1000000 + } + } + }, + "entries": [ + { + "turn": 0, + "kind": "hardware+software", + "set": { + "pcm_kwh": 3672, + "capture_ppm": 864000, + "wall_u_mw": 100, + "floor_kw": 582, + "shed_ppm": 0 + }, + "held": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "proposed": { + "pcm_kwh": 3672, + "capture_ppm": 864000, + "wall_u_mw": 100, + "floor_kw": 582, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 324992, + 940348, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 293295, + 907608, + 907771 + ], + "radius_ppm": 59652, + "eta_before_ppm": 914228, + "eta_after_ppm": 914694, + "budget_before": 64, + "cost": 1, + "verdict": "ok", + "budget_after": 63, + "prev": "0000000000000000000000000000000000000000000000000000000000000000", + "hash": "d26b78c9a97aa0c2b8b73a086a5662c4bf04cf01c58f6dec1d28d150b478a85b" + }, + { + "turn": 1, + "kind": "hardware+software", + "set": { + "pcm_kwh": 3800, + "capture_ppm": 896000, + "floor_kw": 533 + }, + "held": { + "pcm_kwh": 3672, + "capture_ppm": 864000, + "wall_u_mw": 100, + "floor_kw": 582, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 3800, + "capture_ppm": 896000, + "wall_u_mw": 100, + "floor_kw": 533, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 293295, + 907608, + 907771 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 225217, + 877262, + 877193 + ], + "radius_ppm": 92229, + "eta_before_ppm": 914694, + "eta_after_ppm": 915941, + "budget_before": 63, + "cost": 1, + "verdict": "ok", + "budget_after": 62, + "prev": "d26b78c9a97aa0c2b8b73a086a5662c4bf04cf01c58f6dec1d28d150b478a85b", + "hash": "dd9001ed5205e66fc1273ef260229166596033200c2e6cfef132bfd93e237a97" + }, + { + "turn": 2, + "kind": "hardware+software", + "set": { + "capture_ppm": 950000, + "floor_kw": 446 + }, + "held": { + "pcm_kwh": 3800, + "capture_ppm": 896000, + "wall_u_mw": 100, + "floor_kw": 533, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 3800, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 446, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 225217, + 877262, + 877193 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 878234, + 877193 + ], + "radius_ppm": 122738, + "eta_before_ppm": 915941, + "eta_after_ppm": 918163, + "budget_before": 62, + "cost": 1, + "verdict": "ok", + "budget_after": 61, + "prev": "dd9001ed5205e66fc1273ef260229166596033200c2e6cfef132bfd93e237a97", + "hash": "f90cf0f2b5d8a3758182095f92c27eb630d239af546b3fc75b69bc1e36c46bc6" + }, + { + "turn": 3, + "kind": "software", + "set": { + "floor_kw": 392 + }, + "held": { + "pcm_kwh": 3800, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 446, + "shed_ppm": 0 + }, + "proposed": { + "pcm_kwh": 3800, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 392, + "shed_ppm": 0 + }, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 878234, + 877193 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 999215, + 877193 + ], + "radius_ppm": 121766, + "eta_before_ppm": 918163, + "eta_after_ppm": 919548, + "budget_before": 61, + "cost": 1, + "verdict": "ok", + "budget_after": 60, + "prev": "f90cf0f2b5d8a3758182095f92c27eb630d239af546b3fc75b69bc1e36c46bc6", + "hash": "280bf4d6d94659e3b2327f090e981942b0b430e969feee1be11b9b09e11f129f" + } + ], + "final_genome": { + "pcm_kwh": 3800, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 392, + "shed_ppm": 0 + }, + "final_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 120734, + "load_floor": 999215, + "outage_ride_through": 877193 + }, + "final_eta_ppm": 919548, + "final_budget": 60, + "final_hash": "280bf4d6d94659e3b2327f090e981942b0b430e969feee1be11b9b09e11f129f" +} diff --git a/results/model_lessons.md b/results/model_lessons.md new file mode 100644 index 0000000..b3236f7 --- /dev/null +++ b/results/model_lessons.md @@ -0,0 +1,32 @@ +# Notes left by the first recorded proposer + +These are the words of the language model that made the run in `results/model_run.json`, copied from its +closing report without change. It wrote them after its last proposal, having seen only the output of +`tools/propose.py`. The second recorded run (`results/model_run_2.json`) was given this file and nothing else +beyond that same output. Nothing here is checked: it is what one proposer inferred from 11 decisions. + +## What I worked out + +- **Fixed margins:** eleven margins never moved. The largest, floor_punching_collar at 801052, caps the radius at 198948. +- **Objective:** only the two software genes moved it. + - Each kW taken off the load floor gained about 25.5 ppm. + - Removing all shedding gained 9 ppm. + - Capture, wall and thermal store never changed it. They only free up margin that a lower floor then uses. +- **Margins:** these forms fitted every observation to within 2 ppm. + - outage_ride_through = (1 − shed) × 3333.33 / pcm. + - load_floor = G / ((1.62 × capture − 1) × floor), with G ≈ 206.17 + 0.0495 × wall_u. + - sorption_drive_heat = (10000 × (1 − capture) + G) / (6200 × capture). +- **The one refusal:** more shedding eased the outage margin but cost 2 ppm. That pointed to zero shedding, which was only feasible when paired with a larger store. +- **Wrong turn:** my wall probe (132 to 150) tightened load_floor slightly for no gain, so I reversed it to 100. +- **Radius:** letting load_floor fall while raising capture grew the radius from about 60000 to 153000. That let the final floor cut go through in one step. + +## Unclear, or what I would change + +- **Design sits at the limit:** load_floor is 785 ppm from the limit, and this cannot be backed out because raising the floor lowers the objective. By my fitted trend, the last 3 kW (395 to 392) were worth only about 77 ppm. +- **Store size is arbitrary:** with no shedding, any store of 3334 kWh or more should give the same objective, since the store never moved it. I took it to 5000 as a test, and it stayed there. +- **Whole numbers only:** `show` does not say genes must be whole numbers; I learned it from an error. +- **Refusals and turns:** `show` says a refused proposal "costs nothing", but it does use a turn. +- **Budget never binds:** 64 changes against 40 turns means the budget cannot run out first. +- **Verdict words:** "ok" and "worse" are not explained, and I never saw what an over-radius refusal looks like. +- **Rounding:** the objective prints in whole ppm, so the shedding effect sits at the rounding limit. I could not tell whether rule 3 compares rounded or exact values. Margins appear to be rounded up. +- **Ties:** rule 3 accepts an equal objective, which is what made objective-neutral hardware moves possible. The rules could say so plainly. diff --git a/results/model_lessons_2.md b/results/model_lessons_2.md new file mode 100644 index 0000000..f71e10f --- /dev/null +++ b/results/model_lessons_2.md @@ -0,0 +1,42 @@ +# Notes left by the second recorded proposer + +These are the words of the language model that made the run in `results/model_run_2.json`, copied from its +closing report without change. It had no memory of the first run. It was given the output of +`tools/propose.py` and the first proposer's notes in `results/model_lessons.md`. No third run has been made. +Nothing here is checked: it is what one proposer inferred from 4 decisions and the earlier notes. + +## Earlier notes: what I relied on and how it held up + +Relied on, and right: +- **Margin formulas:** all three forecast every margin to within 4 ppm on the first move and 1 ppm after I refitted G at wall 100 to 211.122. +- **Floor gain:** "about 25.5 ppm per kW" held. I saw about 25.4, 25.45, 25.54 and 25.65 across the four moves, rising slightly as the floor fell. +- **Shedding gain:** the first move's +466 fits 18 kW plus roughly 9 ppm, but I did not isolate it. +- **Floor 392 as the lowest feasible:** confirmed, landing at 999215, exactly as the notes said. +- **Wall to 100 and zero shedding with a store above 3334:** both worked. + +Not tested: +- That hardware alone never moves the objective. I always changed the floor in the same proposal. + +Misleading by omission, not wrong: +- The radius cap of 198948 never mattered; I never needed more than 122738. +- The notes gave formulas but no route, final design or final objective. The route and the step count were the real problem. + +## Notes for a third proposer + +- The four proposals in the table above reach 919548 with no refusals. Reuse them as they stand. +- By my arithmetic three cannot work (not tested). Sorption must travel 204258, the first radius is 59652, and the last floor cut uses almost the whole radius. +- Change all five genes in the first proposal. Setting shed to 0 and wall to 100 at once means pcm alone steers outage afterwards (outage = 3333.333 / pcm). +- Use G = 211.122 at wall 100. Margins are rounded up. +- On each move, raise capture and lower the floor together, so load_floor and outage fall by similar amounts while sorption travels. I used about 87% of each radius and never needed more slack. +- Before the last cut, keep outage below load_floor. With floor 447 instead of 446 at move 2, outage would have set the radius and my forecast says the cut to 392 would have missed by about 140 ppm. +- The last cut moves only load_floor and leaves a radius of 785, so nothing further is possible. +- I still never saw a refusal, so the refusal wording remains unknown. + +The table the first note refers to: + +| # | Change | Moved / radius | Objective after | +|---|---|---|---| +| 0 | pcm 3672, capture 864000, wall 100, floor 582, shed 0 | 52250 / 59652 | 914694 | +| 1 | pcm 3800, capture 896000, floor 533 | 80563 / 92229 | 915941 | +| 2 | capture 950000, floor 446 | 104487 / 122738 | 918163 | +| 3 | floor 392 | 120981 / 121766 | 919548 | diff --git a/results/model_run.json b/results/model_run.json new file mode 100644 index 0000000..dfbb84d --- /dev/null +++ b/results/model_run.json @@ -0,0 +1,86 @@ +{ + "schema": "optifab-proposals/1", + "proposer": "A language model (Claude, Anthropic) run as a sub-agent of the session that prepared this version. It was given the output of tools/propose.py and nothing else, and was told not to read the repository. That instruction was not enforced.", + "budget": 64, + "turns": 40, + "start": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "proposals": [ + { + "set": { + "capture_ppm": 860000 + }, + "why": "First small probe. I expect capturing a little more heat in liquid to raise the objective and to ease the sorption drive heat margin. I want to see which margins move and by how much." + }, + { + "set": { + "floor_kw": 580 + }, + "why": "The first probe showed capture eases two margins but leaves the objective unchanged. Now I lower the load floor a little, expecting less forced load to raise the objective while the load floor margin tightens." + }, + { + "set": { + "shed_ppm": 340000 + }, + "why": "Lowering the load floor raised the objective and the load floor margin scaled as one over the floor. Now I probe shedding: I expect more shedding to ease the outage ride through margin, and I want to see whether the objective cares." + }, + { + "set": { + "pcm_kwh": 2650 + }, + "why": "More shedding eased the outage margin but cost 2 ppm of objective, so shedding is not free. Now I try a bigger thermal store instead. I expect it to ease the outage margin and I want to see if it touches the objective or the other margins." + }, + { + "set": { + "wall_u_mw": 150 + }, + "why": "The thermal store eased only the outage margin and left the objective alone. The wall is the last gene I have not probed. I raise its U-value a little to see which margins and whether the objective respond." + }, + { + "set": { + "capture_ppm": 880000, + "wall_u_mw": 100, + "floor_kw": 555 + }, + "why": "Raising the wall U-value was the wrong way: it tightened the load floor margin a little and did nothing for the objective, so I take it to its lowest value. More capture should ease both the sorption and load floor margins, and I spend part of that on a lower load floor to raise the objective." + }, + { + "set": { + "shed_ppm": 0, + "pcm_kwh": 4200 + }, + "why": "The earlier refusal showed that more shedding costs a little objective, so I expect no shedding to gain a little. On its own that would break the outage margin, so I enlarge the thermal store in the same step, which earlier eased that margin without touching the objective. The store is sized so the outage margin ends below the largest fixed margin." + }, + { + "set": { + "capture_ppm": 925000, + "floor_kw": 500 + }, + "why": "Dropping all shedding gained 9 ppm, as the earlier refusal suggested. Now I raise capture again, which I expect to ease the sorption and load floor margins by amounts I can predict from earlier steps. I lower the load floor only part of the way so the load floor margin still falls and the radius grows for the next step." + }, + { + "set": { + "capture_ppm": 950000, + "floor_kw": 450 + }, + "why": "The last step landed where I predicted, so I take capture to its upper bound, which should ease the sorption margin to about 121 thousand and allow the lowest load floor. I lower the floor to 450 for now, which I expect to lift the objective to about 918060 while leaving room to check the load floor margin before the final cut." + }, + { + "set": { + "pcm_kwh": 5000 + }, + "why": "Before the final cut of the load floor uses up the radius, I check one loose end. Dropping shedding gained 9 ppm where the earlier refusal hinted at more, so the larger thermal store in that step may have cost a little. Enlarging the store alone should either leave the objective unchanged, which also makes the outage margin safer, or be refused and show me the cost." + }, + { + "set": { + "floor_kw": 392 + }, + "why": "The thermal store test left the objective unchanged, so the store does not matter to it. The load floor margin has scaled as one over the floor all along, so 392 kW is the lowest whole number that keeps it under the limit, at about 999214. I expect the objective to reach about 919550, and this step uses nearly all the remaining radius." + } + ] +} diff --git a/results/model_run_2.json b/results/model_run_2.json new file mode 100644 index 0000000..97ca4c2 --- /dev/null +++ b/results/model_run_2.json @@ -0,0 +1,47 @@ +{ + "schema": "optifab-proposals/1", + "proposer": "A language model (Claude, Anthropic) run as a second sub-agent of the session that prepared this version, with no memory of the first run. It was given the output of tools/propose.py and the notes the first proposer left in results/model_lessons.md, and was told not to read anything else in the repository. That instruction was not enforced.", + "budget": 64, + "turns": 40, + "start": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000 + }, + "proposals": [ + { + "set": { + "pcm_kwh": 3672, + "capture_ppm": 864000, + "wall_u_mw": 100, + "floor_kw": 582, + "shed_ppm": 0 + }, + "why": "I expect the load floor and outage margins to fall to about 908000 each and the sorption margin to about 293000. That is a move of about 52000 against a radius of 59652, and it should grow the radius to about 92000. I rely on the three margin formulas in the earlier notes and on the note that only floor and shedding move the objective, so the lower floor and zero shedding should add about 470 ppm." + }, + { + "set": { + "pcm_kwh": 3800, + "capture_ppm": 896000, + "floor_kw": 533 + }, + "why": "The first verdict matched the earlier notes' margin formulas to within 4 ppm, so I keep relying on them. I expect sorption near 225217 and both load floor and outage near 877200, a move of about 80600 against a radius of 92229, which should grow the radius to about 122700. The floor drops 49 kW, so I expect the objective to rise by roughly 1250 ppm." + }, + { + "set": { + "capture_ppm": 950000, + "floor_kw": 446 + }, + "why": "The second verdict matched my forecast to the ppm, so the earlier notes' formulas hold. Taking capture to its top bound should drop sorption to about 120734, and floor 446 should hold load floor near 878233, just above the outage margin, a move of about 104500 against a radius of 122738. The floor drops 87 kW, so I expect about 2200 ppm more objective, and the radius left should allow one last floor cut to 392." + }, + { + "set": { + "floor_kw": 392 + }, + "why": "Only the floor changes, so only the load floor margin should move, from 878234 to about 999215, a move of about 120981 against a radius of 121766. The earlier notes say 392 is the lowest floor that stays under the limit with capture at its top and the wall at its bottom, and my own readings agree, since 391 would put the margin over the limit. I expect about 1380 ppm more objective." + } + ], + "lessons_file": "results/model_lessons.md" +} diff --git a/tools/propose.py b/tools/propose.py new file mode 100644 index 0000000..c35ada3 --- /dev/null +++ b/tools/propose.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +"""The proposer's side of the improvement loop, as a command line. + +Anything can propose: a person, a model, a script. It sees the design held, its margins, the objective +and the budget, and it answers with new values for one or more genes and a sentence saying why. The +step function decides (formal/PlantGate.lean, `step`), and the proposal and its reason are appended to +the run file. The run file is the whole state: every call replays it from the start. + + python3 tools/propose.py RUN.json show + python3 tools/propose.py RUN.json try pcm_kwh=2600 shed_ppm=250000 --why "more store, so shed less" + python3 tools/propose.py RUN.json new --budget 64 --turns 40 --proposer "who or what proposes" + +`verify.py` replays the committed run file and checks that it gives the committed ledger. + +The rules printed by `show` were reworded after the two recorded runs, from what the proposers said was +unclear: whole numbers, a refusal using a turn, the verdict words, and equal objectives being allowed. +The two recorded runs saw the earlier wording. +""" +from __future__ import annotations + +import argparse +import json +import math +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(ROOT)) +import loop # noqa: E402 +import verify # noqa: E402 + +UNITS = {"pcm_kwh": "thermal store, kWh of heat", "capture_ppm": "share of IT heat captured in liquid, ppm", + "wall_u_mw": "wall U-value, mW/m2K", "floor_kw": "scheduler's load floor, kW", + "shed_ppm": "share of load shed in a cooling outage, ppm"} + + +def plant() -> dict: + inp = verify.load_inputs() + env = verify.plant_envelope(inp) + return verify.loop_plant(inp, env, verify.margin_vector(inp)) + + +def show(run: dict, pl: dict) -> str: + ledger = loop.run_proposals(pl, run["start"], run["budget"], run["proposals"]) + held = ledger["final_genome"] + m = loop.model(held, pl) + room = loop.oracle.headroom(loop.LIMIT, m["vector"]) + out = ["THE LOOP", "", + "You hold one design of a data-centre campus and may propose another. Gene values are whole numbers.", + "A proposal is taken up, with the verdict `ok`, when:", + " 1. every gene is within its bounds (if not, the verdict is `bounds`);", + " 2. the margin vector moves no farther than the radius, as a straight-line distance over all", + " margins (if not, `distance`). The radius is the headroom of the design held: the smallest gap", + f" between any of its margins and the limit of {loop.LIMIT:,};", + " 3. the objective, in whole parts per million, is not lower (if it is, `worse`). Equal is allowed.", + "A proposal that is taken up costs 1 from the budget and becomes the design held. A refused one", + "costs nothing from the budget, but it does use a turn. With no budget left the verdict is `budget`.", + "Margins are demand over capacity in parts per million, rounded up: lower is safer.", + "", "DESIGN HELD", ""] + for k in loop.oracle.GENES: + kind = "hardware" if k in loop.HARDWARE else "software" + out.append(f" {k:12} = {held[k]:>8} bounds {pl['lo'][k]} to {pl['hi'][k]} {kind}: {UNITS[k]}") + out += ["", "MARGINS (ppm of limit)", ""] + for name, value in m["margins"].items(): + moves = " moves with the genes" if name in loop.MOVING else "" + out.append(f" {name:36} {value:>9}{moves}") + out += ["", f"radius now {room}", f"objective {m['eta_ppm']} ppm (useful IT energy over utility energy)", + f"budget left {ledger['final_budget']} of {run['budget']} changes", + f"turns left {run['turns'] - len(run['proposals'])} of {run['turns']} proposals", ""] + if ledger["entries"]: + out += ["DECISIONS SO FAR", ""] + for e in ledger["entries"]: + dist = math.isqrt(loop.oracle.dist_sq(e["base_ppm"], e["cand_ppm"])) + sets = " ".join(f"{k}={v}" for k, v in e["set"].items()) + out.append(f" {e['turn']:>2} {e['verdict']:8} {sets:44} moved {dist} of radius {e['radius_ppm']}, " + f"objective {e['eta_before_ppm']} -> {e['eta_after_ppm']}") + out.append("") + return "\n".join(out) + + +def main() -> int: + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("run", type=Path) + ap.add_argument("command", choices=["show", "try", "new"]) + ap.add_argument("sets", nargs="*", help="GENE=VALUE, one or more") + ap.add_argument("--why", default="") + ap.add_argument("--budget", type=int, default=verify.LOOP_BUDGET) + ap.add_argument("--turns", type=int, default=40) + ap.add_argument("--proposer", default="") + ap.add_argument("--lessons", default="", help="with new: a file of lessons the proposer was given, relative to the repository") + args = ap.parse_args() + pl = plant() + + if args.command == "new": + if args.run.exists(): + print(f"{args.run} exists; a run is never overwritten", file=sys.stderr) + return 2 + run = {"schema": "optifab-proposals/1", "proposer": args.proposer, "budget": args.budget, "turns": args.turns, + "start": loop.genes(verify.LOOP_START), "proposals": []} + if args.lessons: + run["lessons_file"] = args.lessons + args.run.write_text(json.dumps(run, indent=1) + "\n", encoding="utf-8") + print(show(run, pl)) + return 0 + + run = json.loads(args.run.read_text(encoding="utf-8")) + if args.command == "try": + if len(run["proposals"]) >= run["turns"]: + print("no turns left", file=sys.stderr) + return 2 + try: + sets = {k: int(v) for k, v in (item.split("=", 1) for item in args.sets)} + except ValueError: + print("each proposal is GENE=WHOLE NUMBER", file=sys.stderr) + return 2 + unknown = sorted(set(sets) - set(loop.oracle.GENES)) + if unknown or not sets or not args.why.strip(): + print(f"unknown genes {unknown}" if unknown else "a proposal needs at least one GENE=VALUE and a --why", + file=sys.stderr) + return 2 + run["proposals"].append({"set": sets, "why": args.why.strip()}) + args.run.write_text(json.dumps(run, indent=1) + "\n", encoding="utf-8") + last = loop.run_proposals(pl, run["start"], run["budget"], run["proposals"])["entries"][-1] + print(f"VERDICT: {last['verdict']}" + ("" if last["verdict"] == "ok" else " (nothing changed)")) + print("margins the proposal would give: " + + ", ".join(f"{n} {v}" for n, v in zip(loop.MOVING, last["cand_ppm"][-len(loop.MOVING):]))) + print() + print(show(run, pl)) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/verify.py b/verify.py index 7fe7cf9..02c4885 100644 --- a/verify.py +++ b/verify.py @@ -21,6 +21,7 @@ import hashlib import json import math +import random import re import struct import subprocess @@ -35,13 +36,16 @@ DATA = ROOT / "data" CERT_PATH = ROOT / "results" / "certificate.json" LEDGER_PATH = ROOT / "results" / "ledger.json" +# Recorded runs of outside proposers: certificate key -> (run file, ledger file), both in results/. +RECORDED_RUNS = {"recorded_proposer": ("model_run.json", "model_ledger.json"), + "recorded_proposer_given_lessons": ("model_run_2.json", "model_ledger_2.json")} FORMAL_PATH = ROOT / "results" / "formal.json" FORMAL_DIR = ROOT / "formal" FORMAL_SOURCES = ["PlantGate.lean", "PlantGate/Spec.lean", "PlantGate/Proofs.lean", "Main.lean", "comparator.json", "lakefile.toml", "lean-toolchain", "tests/oracle.py", "tests/run_tests.py"] KELVIN = 273.15 PSF_TO_KPA = 0.04788026 -VERSION = "0.2.0" +VERSION = "0.3.0" # --------------------------------------------------------------------------- inputs @@ -720,22 +724,77 @@ def check_unit(unit: dict, graph: dict) -> dict: LOOP_BUDGET = 64 +def _exact(x: float, scale: int, what: str) -> int: + """A pinned decimal as an integer in a finer unit. Fails if the unit is not fine enough.""" + v = round(x * scale) + assert abs(x * scale - v) < 1e-6, f"{what} = {x} is not a whole number of 1/{scale}: use a finer unit" + return v + + def loop_plant(inp: dict, env: dict, margins: list[dict]) -> dict: - """The pinned upstream values the loop's plant model needs.""" + """The pinned upstream values the loop's plant model needs, as exact integers.""" ff, pins = inp["ff"], inp["pins"] cp = pins["ff.cooling_power"]["value"] + fixed = {m["limit_state"]: math.ceil(m["utilisation"] * 1e6 - 1e-9) for m in margins + if m["limit_state"] != "sorption_drive_heat"} # the certified margins no gene of the loop can move + ua_roof = ff["domain_1_funicular_radiative_roof"]["U_roof_W_m2K"] * pin_value(pins, "ff.floor_mass", "floor_area_m2") + wall = pin_value(pins, "ff.geometry", "perimeter_m") * ff["domain_4_top_down_seismic_cellular_frame"]["total_building_height_m"] + return { + "p_it_w": _exact(ff["domain_5_6_three_tier_tes_and_closed_loop_cooling"]["P_it_MW"], 10**6, "IT load in MW"), + "cop_ppm": _exact(pin_value(pins, "ff.cop_ads", "cop_ads"), 10**6, "sorption COP"), + "ua_roof_mw_k": _exact(ua_roof, 1000, "roof conductance in W/K"), + "wall_area_m2": _exact(wall, 1, "wall area in m2"), + "dt_mk": _exact(env["minimum_load"]["design_temperature_difference_K"], 1000, "design temperature difference in K"), + "other_w": _exact(env["minimum_load"]["other_overhead_MW"], 10**6, "other overhead in MW"), + "passive_w": _exact(env["pue_reproduction"]["passive_sinks_MW"], 10**6, "passive sinks in MW"), + "aux_w": _exact(cp["funi_aux_MW"], 10**6, "auxiliaries in MW"), + "loop_cop_milli": _exact(cp["ates_cop"], 1000, "loop COP"), + "fixed": list(fixed.values()), "fixed_names": list(fixed), + # what could be built or set: declared here, not derived + "lo": {k: loop.BOUNDS[k][0] for k in loop.oracle.GENES}, "hi": {k: loop.BOUNDS[k][1] for k in loop.oracle.GENES}, + } + + +def network_first_look(inp: dict, env: dict, plant: dict) -> dict: + """What a site does to one campus's load floor, and what that means for a network of two. + + Assumption A-4, made here: at any recooling temperature the sorption chiller reaches the same share of + its reversible COP as at the design point (58 C drive, 18 C chilled water, 30 C recooling). The 30 C + is the design value proposed in aska-physical/funi-frame#4, not a certified one.""" + pins, ml, sl = inp["pins"], env["minimum_load"], env["second_law"] + cop = pin_value(pins, "ff.cop_ads", "cop_ads") + t_drive, t_chw = sl["T_drive_C"], sl["T_chilled_C"][1] + share = cop / cop_tri_thermal(t_drive, 30.0, t_chw) + alpha, q_fix = ml["liquid_capture_fraction"], ml["envelope_gain_MW"] + ml["other_overhead_MW"] + nameplate = plant["p_it_w"] / 1e6 + + def site(t_recool: float) -> dict: + c = share * cop_tri_thermal(t_drive, t_recool, t_chw) + gain = (1.0 + c) * alpha - 1.0 + floor = q_fix / gain if gain > 0 else math.inf + return {"recooling_C": t_recool, "sorption_cop": round(c, 3), + "load_floor_MW": round(floor, 3) if floor <= nameplate else None, + "load_floor_share_of_nameplate": round(floor / nameplate, 3) if floor <= nameplate else None, + "cools_itself_at_some_load": floor <= nameplate} + + sites = [site(t) for t in (30.0, 34.0, 36.0, 38.0, 40.0, 41.0)] + cool, warm = sites[0], sites[3] + slope = 1.0 + 1000.0 / plant["loop_cop_milli"] return { - "p_it_kw": ff["domain_5_6_three_tier_tes_and_closed_loop_cooling"]["P_it_MW"] * 1000.0, - "cop_ads": pin_value(pins, "ff.cop_ads", "cop_ads"), - "ua_roof_w_k": ff["domain_1_funicular_radiative_roof"]["U_roof_W_m2K"] * pin_value(pins, "ff.floor_mass", "floor_area_m2"), - "wall_area_m2": pin_value(pins, "ff.geometry", "perimeter_m") * ff["domain_4_top_down_seismic_cellular_frame"]["total_building_height_m"], - "design_dt_k": env["minimum_load"]["design_temperature_difference_K"], - "other_kw": env["minimum_load"]["other_overhead_MW"] * 1000.0, - "passive_kw": env["pue_reproduction"]["passive_sinks_MW"] * 1000.0, - "loop_cop": cp["ates_cop"], "aux_kw": cp["funi_aux_MW"] * 1000.0, - # the certified margins no gene of the loop can move - "fixed_margins_ppm": {m["limit_state"]: math.ceil(m["utilisation"] * 1e6 - 1e-9) for m in margins - if m["limit_state"] != "sorption_drive_heat"}, + "assumption": "A-4: the chiller keeps its design share of the reversible COP at every recooling temperature", + "share_of_reversible_cop_at_design": round(share, 4), + "sites": sites, + "two_campuses": { + "recooling_C": [cool["recooling_C"], warm["recooling_C"]], + "load_floors_MW": [cool["load_floor_MW"], warm["load_floor_MW"]], + "network_load_floor_MW": round(cool["load_floor_MW"] + warm["load_floor_MW"], 3), + "network_load_floor_share_of_nameplate": round((cool["load_floor_MW"] + warm["load_floor_MW"]) / (2 * nameplate), 3), + "warm_floor_over_cool_floor": round(warm["load_floor_MW"] / cool["load_floor_MW"], 2), + }, + # In the upstream plant model utility power is a straight line in IT load, and its slope does not + # depend on the site. So moving load between campuses changes no energy: placement is degenerate. + "utility_MW_per_MW_of_IT_load_at_every_site": round(slope, 4), + "placement_between_campuses_changes_energy_use": False, } @@ -777,7 +836,7 @@ def improvement_loop(inp: dict, env: dict, margins: list[dict]) -> tuple[dict, d frozen = loop.summary(loop.run_loop(plant, frozen_start, LOOP_BUDGET)) below = dict(LOOP_START, floor_kw=500) # a scheduler floor under the load floor of the plant base_m, below_m = loop.model(LOOP_START, plant), loop.model(below, plant) - refused = loop.oracle.gate(base_m["vector"], below_m["vector"], loop.oracle.headroom(loop.LIMIT, base_m["vector"]), LOOP_BUDGET, 1) + refused = (loop.decide(plant, LOOP_START, LOOP_BUDGET, below, "0" * 64)["verdict"],) keep = ("decisions", "admitted", "refused", "budget_left", "eta_final_ppm", "worst_margin_ever_admitted_ppm") report = { "scenario": loop.SCENARIO, "limit_ppm": loop.LIMIT, "proposer_reserve_ppm": reserve, @@ -798,19 +857,115 @@ def improvement_loop(inp: dict, env: dict, margins: list[dict]) -> tuple[dict, d return ledger, report -def formal_record(ledger: dict) -> dict: - """What the committed formal record must say about the current ledger and Lean sources.""" +def reference_optimum(plant: dict) -> dict: + """The best objective found by direct search, to measure a proposer against. + + The objective reads only the two software genes, and falls as the scheduler's floor rises. So the + hardware genes are set to their most generous bounds, and for each of 41 shed levels the floors are + tried upwards until the design is within every limit.""" + hardware = {"pcm_kwh": plant["hi"]["pcm_kwh"], "capture_ppm": plant["hi"]["capture_ppm"], "wall_u_mw": plant["lo"]["wall_u_mw"]} + best = None + for shed in range(plant["lo"]["shed_ppm"], plant["hi"]["shed_ppm"] + 1, 25000): + for floor in range(plant["lo"]["floor_kw"], plant["hi"]["floor_kw"] + 1): + design = dict(hardware, floor_kw=floor, shed_ppm=shed) + m = loop.model(design, plant) + if max(m["vector"]) <= loop.LIMIT: + if best is None or m["eta_ppm"] > best[0]: + best = (m["eta_ppm"], design) + break + return {"objective_ppm": best[0], "design": best[1]} + + +def held_states_ok(ledger: dict, plant: dict) -> dict: + """Walk a ledger and check every design that was taken up, without using the step function.""" + ok = [e for e in ledger["entries"] if e["verdict"] == "ok"] + return { + "every_design_held_within_limit": all(max(e["cand_ppm"]) <= loop.LIMIT for e in ok), + "every_design_held_within_bounds": all(plant["lo"][k] <= e["proposed"][k] <= plant["hi"][k] + for e in ok for k in loop.oracle.GENES), + "objective_never_fell": all(e["eta_after_ppm"] >= e["eta_before_ppm"] for e in ok), + "changes_within_budget": len(ok) + ledger["final_budget"] == ledger["head"]["budget"] and ledger["final_budget"] >= 0, + } + + +def adversary_run(plant: dict, proposals: int = 3000, seed: int = 20261117) -> tuple[dict, dict]: + """A proposer that tries to break the loop: designs out of bounds, past a limit and worse, then random ones.""" + rng = random.Random(seed) + start = loop.genes(LOOP_START) + props = [{"set": {"capture_ppm": 2_000_000}}, {"set": {"pcm_kwh": -1}}, {"set": {"floor_kw": 0}}, + {"set": {"floor_kw": 500}}, {"set": {"floor_kw": 620}}, {"set": {"pcm_kwh": 2400, "shed_ppm": 200_000}}] + for _ in range(proposals): + chosen = rng.sample(loop.oracle.GENES, rng.randint(1, 5)) + if rng.random() < 0.5: # anywhere, including just outside the bounds + props.append({"set": {g: rng.randint(plant["lo"][g] - 50, plant["hi"][g] + 50) for g in chosen}}) + else: # near the start, where the gate may say yes + props.append({"set": {g: start[g] + rng.randint(-3, 3) * loop.STEP[g] for g in chosen}}) + ledger = loop.run_proposals(plant, start, LOOP_BUDGET, props) + verdicts: dict[str, int] = {} + for e in ledger["entries"]: + verdicts[e["verdict"]] = verdicts.get(e["verdict"], 0) + 1 + report = {"proposals": len(props), "seed": seed, "verdicts": dict(sorted(verdicts.items())), + "first_six_verdicts": [e["verdict"] for e in ledger["entries"][:6]], + "taken_up": verdicts.get("ok", 0), "budget": LOOP_BUDGET, "budget_left": ledger["final_budget"], + "eta_start_ppm": ledger["head"]["start_eta_ppm"], "eta_final_ppm": ledger["final_eta_ppm"], + **held_states_ok(ledger, plant), "chain_intact": loop.check_chain(ledger), + "entries_follow_from_one_another": loop.check_continuity(ledger), "final_hash": ledger["final_hash"]} + return ledger, report + + +def proposer_run(plant: dict, seeded: dict, run_file: str) -> tuple[dict | None, dict]: + """Replay the recorded run of an outside proposer and compare it with the seeded search.""" + if not (ROOT / "results" / run_file).exists(): + return None, {"present": False} + run = read_json(ROOT / "results" / run_file) + ledger = loop.run_proposals(plant, run["start"], run["budget"], run["proposals"]) + s = loop.summary(ledger) + best = reference_optimum(plant) + gain = lambda eta: round((eta - s["eta_start_ppm"]) / (best["objective_ppm"] - s["eta_start_ppm"]), 4) + edited = copy.deepcopy(run["proposals"]) + for prop in edited: # change the first proposal that was taken up by one unit + gene = next(iter(prop["set"])) + prop["set"][gene] += 1 + break + report = { + "present": True, "proposer": run["proposer"], "run_file": f"results/{run_file}", + **({"lessons_file": run["lessons_file"]} if "lessons_file" in run else {}), + "turns_allowed": run["turns"], "proposals": len(run["proposals"]), + "every_proposal_has_a_reason": all(p.get("why", "").strip() for p in run["proposals"]), + **{k: s[k] for k in ("admitted", "refused", "admitted_hardware_changes", "admitted_software_changes", + "admitted_changes_to_both_at_once", "budget_start", "budget_left", "eta_start_ppm", + "eta_final_ppm", "worst_margin_ever_admitted_ppm", "final_genome", "chain_intact", + "entries_follow_from_one_another", "final_hash")}, + **held_states_ok(ledger, plant), + "final_margins_ppm": ledger["final_margins_ppm"], + "best_objective_found_by_direct_search": best, + "share_of_the_possible_gain_reached": gain(s["eta_final_ppm"]), + "against_the_seeded_search": { + "seeded": {"proposals": seeded["decisions"], "changes": seeded["admitted"], "eta_final_ppm": seeded["eta_final_ppm"], + "share_of_the_possible_gain_reached": gain(seeded["eta_final_ppm"])}, + "recorded": {"proposals": len(run["proposals"]), "changes": s["admitted"], "eta_final_ppm": s["eta_final_ppm"], + "share_of_the_possible_gain_reached": gain(s["eta_final_ppm"])}, + }, + "edited_proposal_changes_the_ledger": + loop.run_proposals(plant, run["start"], run["budget"], edited)["final_hash"] != ledger["final_hash"], + } + return ledger, report + + +def formal_record(ledgers: dict) -> dict: + """What the committed formal record must say about the current ledgers and Lean sources.""" if not FORMAL_PATH.exists(): return {"present": False} rec = read_json(FORMAL_PATH) return {"present": True, "lean": rec["lean"], "theorems": rec["theorems"], "comparator": rec["comparator"], "replay": rec["replay"], "differential_tests": rec["differential_tests"], "bar": rec["bar"], "matches_current_lean_sources": rec["sources_sha256"] == formal_sources_hash(), - "matches_current_ledger": rec["ledger_hash"] == ledger["final_hash"]} + "matches_current_ledgers": rec.get("ledger_hashes") == {k: l["final_hash"] for k, l in ledgers.items()}, + "matches_current_ledger": rec.get("ledger_hashes", {}).get("seeded_search") == ledgers["seeded_search"]["final_hash"]} -def run_formal(ledger: dict) -> int: - """Rebuild the proofs, run the comparator and the differential tests, and replay the ledger in Lean.""" +def run_formal(ledgers: dict) -> int: + """Rebuild the proofs, run the comparator and the differential tests, and replay every ledger in Lean.""" def sh(cmd, **kw): return subprocess.run(cmd, cwd=FORMAL_DIR, capture_output=True, text=True, **kw) @@ -824,10 +979,17 @@ def sh(cmd, **kw): tests = sh([sys.executable, "tests/run_tests.py"]) results = (FORMAL_DIR / "tests" / "TEST-RESULTS.md").read_text(encoding="utf-8") field = lambda name: re.search(rf"^- {name}: (.+)$", results, flags=re.M).group(1) - lines = loop.replay_lines(ledger) - out = sh([str(FORMAL_DIR / ".lake" / "build" / "bin" / "plantgate")], input="\n".join(lines) + "\n").stdout.split("\n") - mismatches = [e["generation"] for e, got in zip(ledger["entries"], out) - if got != f"{e['verdict']} {e['budget_after']}"] + replay, mismatches = {}, 0 + for name, ledger in ledgers.items(): + lines = loop.replay_lines(ledger) + out = sh([str(FORMAL_DIR / ".lake" / "build" / "bin" / "plantgate")], input="\n".join(lines) + "\n").stdout.split("\n") + bad = sum(1 for want, got in zip(loop.replay_expected(ledger), out) if got != want) + max(0, len(lines) - len(out)) + whole, want_whole = loop.replay_whole(ledger) # the same run in one piece, through the proved `loop` and `changes` + got_whole = sh([str(FORMAL_DIR / ".lake" / "build" / "bin" / "plantgate")], input=whole + "\n").stdout.strip() + bad += got_whole != want_whole + replay[name] = {"decisions": len(lines), "mismatches": bad, "whole_run_through_lean_loop_agrees": got_whole == want_whole} + mismatches += bad + decisions = sum(r["decisions"] for r in replay.values()) lean = sh(["lake", "env", "lean", "--version"]).stdout.strip() record = { "schema": "optifab-formal/1", "lean": lean, @@ -835,16 +997,16 @@ def sh(cmd, **kw): "comparator": {"command": "lake comparator --paranoid", "accepted": accepted, "kernels": kernels}, "differential_tests": {"inputs": int(field("Inputs")), "seed": int(field("Seed")), "failures": int(field("Failures")), "passed": tests.returncode == 0}, - "replay": {"decisions": len(lines), "mismatches": len(mismatches)}, + "replay": {"decisions": decisions, "mismatches": mismatches, "by_ledger": replay}, "bar": "Proven Commons bar check: items 2 to 6 pass; item 1 is open (no reviewer has approved the specification). See formal/BAR-REPORT.md.", - "sources_sha256": formal_sources_hash(), "ledger_hash": ledger["final_hash"], + "sources_sha256": formal_sources_hash(), "ledger_hashes": {k: l["final_hash"] for k, l in ledgers.items()}, } ok = accepted and tests.returncode == 0 and not mismatches and int(field("Failures")) == 0 if ok: FORMAL_PATH.write_text(json.dumps(record, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") print(f"[FORMAL] comparator {'accepts' if accepted else 'REJECTS'} {len(record['theorems'])} theorems under {len(kernels)} kernels; " f"{record['differential_tests']['inputs']} differential tests, {record['differential_tests']['failures']} failures; " - f"ledger replay {len(lines)} decisions, {len(mismatches)} mismatches") + f"ledger replay {decisions} decisions, {mismatches} mismatches") return 0 if ok else 1 @@ -985,7 +1147,8 @@ def _rejects(fn) -> bool: def must_fail_controls(inp: dict, env: dict, margins: list[dict], radius: dict, rank: dict, max_depth: int, - timing: dict, frames: dict, ledger: dict, evolution: dict, formal: dict) -> dict: + timing: dict, frames: dict, ledger: dict, evolution: dict, formal: dict, + adversary: dict, recorded_runs: dict, network: dict) -> dict: pins, graph, sources = inp["pins"], inp["graph"], inp["sources"] sub, sl, ml = env["substation"], env["second_law"], env["minimum_load"] cop = pin_value(pins, "ff.cop_ads", "cop_ads") @@ -1049,6 +1212,13 @@ def unit_gap(): variants = evolution["variants"] edited = copy.deepcopy(ledger) edited["entries"][0]["verdict"] = "ok" if edited["entries"][0]["verdict"] != "ok" else "distance" + rehashed = copy.deepcopy(ledger) # one entry starts from a design nobody held; every hash is then made good again + rehashed["entries"][1]["held"] = dict(rehashed["entries"][1]["held"], pcm_kwh=rehashed["entries"][1]["held"]["pcm_kwh"] + 1) + prev = "0" * 64 + for e in rehashed["entries"]: + e["prev"] = prev + e["hash"] = prev = loop.digest({k: v for k, v in e.items() if k != "hash"}) + rehashed["final_hash"] = prev flipped = copy.deepcopy(inp["weft_vectors"]) flipped["weight_update_vectors"][1]["expected_accepted"] = False drift = interface_checks(inp, floor_mass_override=200.0) @@ -1110,13 +1280,35 @@ def unit_gap(): "must_fail_24_formal_record_is_stale_or_missing": formal.get("present", False) and formal["matches_current_lean_sources"] and formal["matches_current_ledger"] and formal["comparator"]["accepted"] and formal["replay"]["mismatches"] == 0 - and formal["replay"]["decisions"] == evolution["decisions"], + and formal["matches_current_ledgers"] + and formal["replay"]["by_ledger"]["seeded_search"]["decisions"] == evolution["decisions"], + "must_fail_25_adversary_moves_the_design_out_of_its_envelope": + adversary["first_six_verdicts"] == ["bounds", "bounds", "distance", "distance", "worse", "distance"] + and adversary["taken_up"] > 0 and adversary["every_design_held_within_limit"] + and adversary["every_design_held_within_bounds"] and adversary["objective_never_fell"] + and adversary["changes_within_budget"] and adversary["chain_intact"], + "must_fail_26_recorded_run_of_an_outside_proposer_breaks_a_rule_or_can_be_edited_unseen": + recorded_runs["recorded_proposer"]["present"] and all( + r["every_proposal_has_a_reason"] and r["chain_intact"] and r["every_design_held_within_limit"] + and r["every_design_held_within_bounds"] and r["objective_never_fell"] and r["changes_within_budget"] + and r["proposals"] <= r["turns_allowed"] and r["edited_proposal_changes_the_ledger"] + for r in recorded_runs.values() if r["present"]), + "must_fail_28_ledger_whose_entries_do_not_follow_from_one_another_passes": + loop.check_continuity(ledger) and loop.check_chain(rehashed) and not loop.check_continuity(rehashed) + and adversary["entries_follow_from_one_another"] + and all(r["entries_follow_from_one_another"] for r in recorded_runs.values() if r["present"]) + and all(r.get("whole_run_through_lean_loop_agrees", False) for r in formal["replay"]["by_ledger"].values()), + "must_fail_27_warm_site_campus_counted_with_the_design_load_floor": + abs(network["sites"][0]["load_floor_MW"] - ml["P_min_envelope_plus_overhead_MW"]) < 0.001 + and network["two_campuses"]["warm_floor_over_cool_floor"] > 2.0 + and not network["sites"][-1]["cools_itself_at_some_load"] + and network["sites"][-1]["recooling_C"] < sl["max_recooling_C_at_chilled_18C"], } return controls # --------------------------------------------------------------------------- certificate -def build_certificate(with_ledger: bool = False): +def build_certificate(with_ledger: bool = False, check: bool = True): inp = load_inputs() pins = inp["pins"] rank = pins["f0.evidence_rank"]["value"] @@ -1136,8 +1328,32 @@ def build_certificate(with_ledger: bool = False): frames = plant_frame_checks(inp, margins, radius["plant_radius"], env) unit = check_unit(inp["unit"], inp["graph"]) ledger, evolution = improvement_loop(inp, env, margins) - formal = formal_record(ledger) - controls = must_fail_controls(inp, env, margins, radius, rank, max_depth, timing, frames, ledger, evolution, formal) + plant = loop_plant(inp, env, margins) + adversary_ledger, adversary = adversary_run(plant) + ledgers = {"seeded_search": ledger, "adversary": adversary_ledger} + recorded_runs = {} + for key, (run_file, _) in RECORDED_RUNS.items(): + run_ledger, recorded_runs[key] = proposer_run(plant, evolution, run_file) + if run_ledger is not None: + ledgers[key] = run_ledger + recorded = recorded_runs["recorded_proposer"] + second = recorded_runs["recorded_proposer_given_lessons"] + if second["present"]: # what the lessons of the first run were worth to the second + first_reached = lambda r, target: next((i + 1 for i, e in enumerate(ledgers[r]["entries"]) + if e["verdict"] == "ok" and e["eta_after_ppm"] >= target), None) + target = min(recorded["eta_final_ppm"], second["eta_final_ppm"]) + second["against_the_first_run"] = { + "objective_both_runs_reached_ppm": target, + "proposals_needed_first_run": first_reached("recorded_proposer", target), + "proposals_needed_with_lessons": first_reached("recorded_proposer_given_lessons", target), + "refused_first_run": sum(recorded["refused"].values()), "refused_with_lessons": sum(second["refused"].values()), + "eta_final_first_run_ppm": recorded["eta_final_ppm"], "eta_final_with_lessons_ppm": second["eta_final_ppm"], + "lessons_file_sha256": sha256_bytes((ROOT / second["lessons_file"]).read_bytes()), + } + formal = formal_record(ledgers) + network = network_first_look(inp, env, plant) + controls = must_fail_controls(inp, env, margins, radius, rank, max_depth, timing, frames, ledger, evolution, formal, + adversary, recorded_runs, network) assert env["pue_reproduction"]["liquid_plus_air_equals_it_load"] and env["pue_reproduction"]["matches_certificate"] assert not env["second_law"]["certificate_has_a_recooling_field"], "funi-frame now carries a recooling field: revisit finding 2" @@ -1149,7 +1365,7 @@ def build_certificate(with_ledger: bool = False): assert graph["aska_physical_to_moissanite_links_before"] == 0 and graph["aska_physical_to_moissanite_links_added"] >= 1 assert frames["matches_weft_frame_layout"] and frames["gate_from_frame"]["design point"] == "ok" assert not unit["loop_closed"], "the loop is reported closed; check data/unit.json before believing it" - assert all(controls.values()), [k for k, v in controls.items() if not v] + assert not check or all(controls.values()), [k for k, v in controls.items() if not v] overhead_cut = (ts["PUE_conventional"] - ts["PUE_funi_frame"]) / (ts["PUE_conventional"] - 1.0) * 100.0 data_files = ["pins.json", "graph.json", "sources.json", "unit.json", "upstream/MANIFEST.json"] @@ -1175,6 +1391,9 @@ def build_certificate(with_ledger: bool = False): "funi_frame_evidence": "claimed", }, "improvement_loop": evolution, + "network_first_look": network, + "adversarial_proposer": adversary, + **recorded_runs, "formal": formal, "loop_timing": timing, "plant_frame": frames, @@ -1183,7 +1402,7 @@ def build_certificate(with_ledger: bool = False): "must_fail_controls": controls, "controls_passed": f"{sum(controls.values())}/{len(controls)}", } - return (cert, ledger) if with_ledger else cert + return (cert, ledgers) if with_ledger else cert # --------------------------------------------------------------------------- upstream re-check @@ -1295,21 +1514,28 @@ def main() -> int: if status or args.repin: return status if args.formal: - inp = load_inputs() - env, margins = plant_envelope(inp), margin_vector(inp) - if run_formal(improvement_loop(inp, env, margins)[0]): + if run_formal(build_certificate(with_ledger=True, check=False)[1]): return 1 - cert, ledger = build_certificate(with_ledger=True) + cert, ledgers = build_certificate(with_ledger=True) + ledger = ledgers["seeded_search"] if args.write: CERT_PATH.parent.mkdir(parents=True, exist_ok=True) CERT_PATH.write_text(json.dumps(cert, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") LEDGER_PATH.write_text(json.dumps(ledger, indent=1, ensure_ascii=False) + "\n", encoding="utf-8") + for key, (_, ledger_file) in RECORDED_RUNS.items(): + if key in ledgers: + (ROOT / "results" / ledger_file).write_text(json.dumps(ledgers[key], indent=1, ensure_ascii=False) + "\n", encoding="utf-8") if not CERT_PATH.exists() or read_json(CERT_PATH) != cert: print("ERROR: results/certificate.json does not match verify.py. Run with --write after a deliberate change.", file=sys.stderr) return 1 if not LEDGER_PATH.exists() or read_json(LEDGER_PATH) != ledger: print("ERROR: results/ledger.json does not match the loop. Run with --write after a deliberate change.", file=sys.stderr) return 1 + for key, (run_file, ledger_file) in RECORDED_RUNS.items(): + path = ROOT / "results" / ledger_file + if key in ledgers and (not path.exists() or read_json(path) != ledgers[key]): + print(f"ERROR: results/{ledger_file} does not match results/{run_file}. Run with --write.", file=sys.stderr) + return 1 g, m, p = cert["graph"], cert["margins"], cert["plant"] print(f"[PASS] optifab v{VERSION}: {cert['controls_passed']} controls, " f"Weft vectors {cert['gate']['weft_conformance']['passed']}/{cert['gate']['weft_conformance']['weight_update_vectors']}, " @@ -1319,7 +1545,9 @@ def main() -> int: f"recooling limit {p['second_law']['max_recooling_C_at_chilled_18C']} C, " f"lineage depth {g['optifab_lineage_depth']} of {g['lineage_depth_bound']}, " f"loop {cert['improvement_loop']['admitted']} changes admitted of {cert['improvement_loop']['decisions']} proposed, " - f"Lean replay {cert['formal']['replay']['mismatches']} mismatches, " + f"recorded proposer {cert['recorded_proposer']['admitted']} of {cert['recorded_proposer']['proposals']}, " + f"adversary held to the envelope over {cert['adversarial_proposer']['proposals']} proposals, " + f"Lean replay {cert['formal']['replay']['decisions']} decisions {cert['formal']['replay']['mismatches']} mismatches, " f"unit {cert['unit']['repositories_placed']} repositories placed, " f"{cert['unit']['loop_interfaces_by_status'].get('checked', 0)} of {cert['unit']['loop_interfaces']} interfaces checked") return 0