Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.
Rust ai-nativedescription-logicsformal-verificationinfrastructure-as-codeisabelle-languageknowledge-graphleanlean4mcpmcp-serverontologyowlowl2reasoningrustshaclsparqltheorem-proving
Verify the budget, the realizer and the CI skips, and correct what the audit found
FABIOTESSa559f8648bdb
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 61acd40c..07d9ba60 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -261,7 +261,7 @@ jobs:# tests need, and `python/tests/conftest.py` makes `OO_REQUIRE_FIXTURES=1` mean# on this side what it has meant on the Rust side since `tests/common/mod.rs`:# a skip is a failure. The strict leg below names the files whose dependencies- # this job actually provides, exactly as the `lean` job names its fifteen.+ # this job actually provides, exactly as the `lean` job names its nineteen.python:# 15 was enough for `pytest -q` on a pure-Python suite. This job now builds# `lean/` and a release binary, which is what the `lean` job budgets 45 for.diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7aee3995..daf72dee 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -651,24 +651,32 @@ All notable changes to Open Ontologies are documented here.- **`classify_timeout_ms` had never bounded a real run, and now bounds one orsays it does not.** It defaults to 180 000 ms and its own documentation calledit "the budget that actually bounds the run". Two separate reasons it was- neither. It COULD NOT FIRE: five phases — consistency, satisfiability,- subsumption, ABox, explanation — each open a `tableaux_test_timeout_ms` budget- of 10 000 ms, and five times ten is fifty, which is less than a hundred and- eighty, so the ceiling was dead arithmetic. And it DID NOT COVER THE RUN: the- setting was read inside `classify_parallel` and nowhere else, so the three- phases around classification each opened a fresh budget outside it and a run- could exceed its own ceiling by three further phase budgets. The explanation- loop had no wall clock at all — `Tableau::new_with_tracing` leaves- `Budget::deadline` at `None` — and `run` performs one such tableau per- unsatisfiable class, in a loop, straight after a classification that may have- just been cut short for want of exactly that budget.+ neither. AT THE SHIPPED SETTINGS IT COULD NOT FIRE: four phases —+ consistency, satisfiability, subsumption, ABox — each opened a+ `tableaux_test_timeout_ms` budget of 10 000 ms, and four times ten is forty,+ which is less than a hundred and eighty, so the ceiling was dead arithmetic.+ And it DID NOT COVER THE RUN: the setting was read inside `classify_parallel`+ and nowhere else, so the three phases around classification each opened a fresh+ budget outside it and a run could exceed its own ceiling by three further phase+ budgets. WITNESSED, not inferred: with `classify_timeout_ms` set to 1 ms over+ an 80-class ontology, the pre-fix engine reported+ `budget_exhausted_in: ["satisfiability", "subsumption"]` and no `abox` — the+ ABox check had opened a fresh 10 000 ms deadline after the ceiling was already+ spent. The explanation loop, the fifth phase, had no wall clock AT ALL —+ `Tableau::new_with_tracing` leaves `Budget::deadline` at `None` — and `run`+ performs one such tableau per unsatisfiable class, in a loop, straight after a+ classification that may have just been cut short for want of exactly that+ budget.The ceiling is now enforced over every phase, by intersecting it with eachphase's own deadline rather than by minting a fifth budget beside them. Thatcosts nothing measurable: a tableau already checks one deadline inside itsexpansion loop, and it is now handed the earlier of the two. Minting a deadlineper TABLEAU is what would make 180 000 ms the bound that fires, and it is whattook the corpus from 67s to over 600s with no verdict changing; it is still not- done. What is done instead is the part that was missing, which is SAYING SO:+ done. That 67s is a number from an earlier session over a corpus nobody wrote+ down, kept as the reason a route was abandoned and flagged in the source as+ unreproducible, which is why `tests/reasoner_budget_corpus_bench.rs` now pins+ two corpora that ARE in the tree. What is done instead is the part that was missing, which is SAYING SO:every `owl-dl` run now carries a `budget` block naming both settings, the fivephases, the worst case the phase budgets permit, which of the two boundsactually stops the run — `global`, `phase`, or `none` — and a sentence of prose@@ -684,19 +692,26 @@ All notable changes to Open Ontologies are documented here.was documented as "used by the CLI `--reason-timeout-ms` flag", and there is nosuch flag anywhere in `src/` — grep for it and the only hit is the sentenceclaiming it. Neither reasoner clock had a user-reachable setting of any kind,- and both were documented as though they did. A ceiling nobody can lower is the- strongest form of a limit that enforces nothing, and the note this now prints- tells a reader to lower it. `[reasoner] classify_timeout_ms` and+ and both were documented as though they did. Worse than unreachable: `Config`+ does not deny unknown fields, so a user who wrote+ `[reasoner] classify_timeout_ms = 30000` got a clean parse, no warning and no+ effect — the setting was accepted and discarded. A ceiling nobody can lower is+ the strongest form of a limit that enforces nothing, and the note this now+ prints tells a reader to lower it. `[reasoner] classify_timeout_ms` and`[reasoner] tableaux_test_timeout_ms` are real keys; `0` means OFF for both,not "use the default", which is the opposite of the three caps beside them andis documented where they are declared.Corpus cost, measured with the new and reproducible- `tests/reasoner_budget_corpus_bench.rs` over two corpora, the two builds run- back to back under the same machine load: the twenty case-study ontologies,- none of which reaches a budget, 0.10s before and 0.10s after; ten from- `benchmark/` that do, two of them exhausting one, 64.53s before and 63.84s- after. Unchanged, and it has to be, because at the shipped settings the- intersection produces the same instant the phase budget alone did. Pinned by+ `tests/reasoner_budget_corpus_bench.rs` over two corpora, THREE runs of each+ build alternating so they share the machine's load. Twenty case-study+ ontologies, none of which reaches a budget: 0.33 / 0.09 / 0.09s before,+ 0.10 / 0.34 / 0.08s after. Ten from `benchmark/` that do, two of them+ exhausting one: 62.42 / 62.78 / 65.10s before, 63.75 / 62.62 / 64.55s after.+ Unchanged — the "after" range lies inside the "before" range, and two runs of+ the SAME build differ by more than the two builds do. One run of each would not+ have shown that, and the first pair taken did read as a one-second regression.+ It also has to be unchanged, because at the shipped settings the intersection+ produces the same instant the phase budget alone did. Pinned by`tests/reasoner_global_budget_test.rs`.- **Definition realization skipped every individual without a named`rdf:type`.** `realize_definitions` iterated `individual_types`, so an@@ -713,6 +728,52 @@ All notable changes to Open Ontologies are documented here.cannot widen what matches: `satisfies` declines everything outside itsfragment, so an empty named-type set can only fail. Pinned by three tests in`tests/abox_realization_test.rs`, one of them a negative control.+- **The three-way differential skipped in CI, and the green tick said nothing+ about it.** The `python` job installed the `dev` extra and nothing else: no+ `cargo build`, so no Rust engine; no elan, so no `oo-horn`.+ `test_horn_three_way_differential.py` ran its own preflight, found neither of+ the two implementations it compares against this one, and skipped every test in+ the file. MEASURED on this tree with the engine hidden: `14 skipped`, exit 0.+ A gate that passes by not running, in the repository that exists to attack+ that. Three more files skipped for want of `pyshacl` and `hnswlib`, two extras+ the job did not install.++ Two things were missing and both are here. The job now BUILDS what the tests+ need — `leanprover/lean-action` on `lean/` for `oo-horn`, a release build of+ the engine, and the `shacl` and `align` extras — and `python/tests/conftest.py`+ makes `OO_REQUIRE_FIXTURES=1` mean on this side what `tests/common/mod.rs` has+ made it mean on the Rust side: a skip is a failure. The rule is GLOBAL rather+ than per-call-site, because in Python a skip needs no helper to write and a+ per-call-site rule would miss the next one; a skip that is deliberate rather+ than missing carries `@pytest.mark.oo_opt_in`, and there is exactly one, the+ twelve-minute full-corpus run. Collection-time skips are caught too, through+ `pytest_collectreport`, or the three `importorskip` files would have stayed+ exempt from a rule written only in `pytest_runtest_makereport`.++ Both directions measured, on this tree, same command: with the engine hidden,+ `4 failed, 1 skipped, 9 errors`, exit 1 — it can fail. With everything present,+ `67 passed, 1 skipped`, exit 0, and the one skip is the opt-in twelve-minute+ differential. Four Rust files in the same position — `certificate_boundary_proptest`,+ `reason_rl_coverage_test`, `rule_syntax_frontend_test`, `reason_horn_emit_test`+ — each call `common::skip_unless` on lake, and lake is installed in the `lean`+ job, but no leg there invoked them: so in the one job that could have run them+ they were not run, and in the job that ran them (`build`, with no lake) they+ skipped. They are now four strict legs in `lean`, and pass.+- **`docs/ci-gates.md`: which gates actually run, as a table.** Thirty-four test+ files in this repository can skip, twenty-five Rust and nine Python. For each,+ the table says what it needs, whether any job provides it, and whether the skip+ becomes a failure there. Nineteen Rust and eight Python files are strict; five+ Rust and one Python file skip wherever they run, and the reason is written down+ for each, with what closing it would cost; the twenty-fifth Rust file is the+ new corpus bench, `#[ignore]`d because it measures wall clock, which the table+ records as not run BY DESIGN rather than letting it read as an oversight.+ `claimcheck_pizza_bench.rs` was the+ one skip in the Rust suite invisible to BOTH halves of the convention: it+ printed a bare `SKIP:` that the `build` job's counter does not match and that+ `OO_REQUIRE_FIXTURES=1` could not promote. It goes through `skip_unless` now+ and still skips everywhere, which is now visible. The three commands that+ regenerate the three lists are at the bottom of the page, so the table can be+ re-derived rather than trusted.### Known defects- **`owl:AsymmetricProperty` is not modelled.** It is now DECLARED, indiff --git a/README.md b/README.mdindex fd9dae97..329cdae4 100644--- a/README.md+++ b/README.md@@ -235,6 +235,7 @@ a Protégé-style inspector. No JVM. No Protégé.| Architecture | [docs/architecture.md](docs/architecture.md) || Derivation certificates and the Lean checkers | [docs/lean-certificates.md](docs/lean-certificates.md) || What the Lean proofs assume about the Rust | [docs/trusted-computing-base.md](docs/trusted-computing-base.md) |+| Which gates a green CI tick actually ran | [docs/ci-gates.md](docs/ci-gates.md) || First-order export, TPTP and Common Logic | [docs/first-order-export.md](docs/first-order-export.md) || Every reasoning system, and why each was used or refused | [docs/reasoning-systems-inventory.md](docs/reasoning-systems-inventory.md) || Design decisions, one rule per file | [docs/decisions/](docs/decisions/) |diff --git a/docs/ci-gates.md b/docs/ci-gates.mdindex 14064967..6fecc873 100644--- a/docs/ci-gates.md+++ b/docs/ci-gates.md@@ -8,8 +8,8 @@ over the same documents — ran its preflight, found neither of the two tools itneeds, skipped every test in the file, and exited 0.This page is the answer to "does a green tick mean this ran?", so that nobody has-to work it out again from six workflow files and the thirty-three test files that-can skip — twenty-four Rust, nine Python. It is a statement about CI+to work it out again from six workflow files and the thirty-four test files that+can skip — twenty-five Rust, nine Python. It is a statement about CIconfiguration, which changes; the date it was last checked is at the bottom, andthe way to re-check it is at the bottom too.@@ -70,6 +70,7 @@ job invokes the file at all.| `embed_test.rs` | ONNX model in `~/.open-ontologies/models/` | `features/depth` compiles it; no job runs `open-ontologies init` | **skips** || `embedding_e2e_test.rs` | same ONNX model + tokenizer | same | **skips** || `claimcheck_pizza_bench.rs` | `/tmp/pizza_compiled.json` from `CompileOntology.java` | only `benchmark.yml` has a JDK, it is `workflow_dispatch` and does not produce the file | **skips** |+| `reasoner_budget_corpus_bench.rs` | the tracked corpus (in tree) | any job — but the one test is `#[ignore]` | **not run**, by design: it is a wall-clock measurement, run by hand |`fol_model_ingest_test.rs` runs in the `lean` job under the same variable and hasno skip path at all, which is why it is not in the table.@@ -107,6 +108,15 @@ The other seven files under `python/tests/` have no skip path.- **`test_dataframe.py`.** `fenic` is an undeclared optional test dependency.Declaring it as an extra and installing it in the `python` job is the fix; itwas not made here because the dependency has not been assessed.+- **Two skips inside now-strict Python files are conditions, not missing+ toolchains, and `OO_REQUIRE_FIXTURES=1` will fail the job on either.** Both are+ wanted. `test_horn_differential.py` skips a corpus file that pyoxigraph cannot+ parse; a file under `demo/` that does not parse is a defect and should stop the+ job rather than vanish into an `s`. `test_horn_rule_table.py` skips when `git`+ is absent or the tree is not a checkout, which on a GitHub runner after+ `actions/checkout` cannot happen. Measured on the current tree: the eight+ strict Python files are 67 passed, 1 skipped, and the one skip is the+ `oo_opt_in` twelve-minute differential.- **The `features/breadth` job runs no tests** (`test: false`); it is`cargo check` plus clippy across all features. That is deliberate and is not askip, but it does mean an all-features build is type-checked and never run.@@ -121,13 +131,15 @@ The other seven files under `python/tests/` have no skip path.## Re-checking this page```bash-# every Rust file that can skip+# every Rust file that can skip — 25, and the table has 25 rowsgrep -ln 'skip_unless\|SKIPPED_FIXTURE' tests/*.rs-# every Python file that can skip+# every Python file that can skip — 10 hits, of which conftest.py is the+# mechanism and not a test, so 9, and the table has 9 rowsgrep -rln 'pytest.skip\|importorskip\|skipif' python/tests/*.py# every leg CI makes strictgrep -rn 'OO_REQUIRE_FIXTURES=1' .github/workflows/```The three lists have to reconcile against the table above. Last checked against-`.github/workflows/` on 14 September 2026.+`.github/workflows/` on 15 September 2026, by running each of the three commands+and counting.diff --git a/docs/trusted-computing-base.md b/docs/trusted-computing-base.mdindex 4e116def..81e32df5 100644--- a/docs/trusted-computing-base.md+++ b/docs/trusted-computing-base.md@@ -237,6 +237,15 @@ whole extra TSV line; combining characters against their precomposed form; NUL;language tags; typed literals; percent-encoded separators inside IRIs) and adversarial rule tables,and then drive the real public entry points.+**Where this runs.** `tests/certificate_boundary_proptest.rs` needs lake, because the TCB-19/TCB-21+leg puts the adversarial shapes through `oo-horn check` itself. Until 15 September 2026 no CI job+invoked it: the `build` job ran it with no lake and it skipped, and the `lean` job, which has lake,+never named it. It is now a strict leg of the `lean` job under `OO_REQUIRE_FIXTURES=1`, so the+skip is a failure there, and so are `reason_rl_coverage_test`, `rule_syntax_frontend_test` and+`reason_horn_emit_test`, which were in the same position. `docs/ci-gates.md` is the table of which+gate runs where, and Kani is still in no job at all, which is why the section below reports its+results rather than pointing at a build.+### Bounded model checkingKani 0.67.0 installed and ran here, on `nightly-2025-11-21-aarch64-apple-darwin`, over the wholediff --git a/python/tests/conftest.py b/python/tests/conftest.pyindex df2af9e3..598bcb0d 100644--- a/python/tests/conftest.py+++ b/python/tests/conftest.py@@ -3,7 +3,7 @@The Rust suite has had this since `tests/common/mod.rs` was written: a test thatskips for want of a toolchain prints a `SKIPPED_FIXTURE:` marker, and any jobthat is supposed to PROVIDE that toolchain sets `OO_REQUIRE_FIXTURES=1`, which-makes the skip fatal. The `lean` job runs fifteen legs that way, and+makes the skip fatal. The `lean` job runs nineteen legs that way, and`w3c-shacl` one more. The Python suite had no equivalent of any kind: no`conftest.py` existed, no test read the variable, and every `pytest.skip` and`pytest.importorskip` in `python/tests/` was unconditional and unpromotable.diff --git a/src/main.rs b/src/main.rsindex 6aa78524..0e278e76 100644--- a/src/main.rs+++ b/src/main.rs@@ -121,6 +121,16 @@ data_dir = "~/.open-ontologies"# tableaux_max_depth = 100# tableaux_max_nodes = 10000# max_iterations = 64+# Wall clocks. NOTE the different meaning of 0: for the three caps above 0 means+# "unset, use the default", and for these two it means NO LIMIT, because a depth+# cap of zero is not a configuration anybody wants and a timeout of zero is.+# tableaux_test_timeout_ms = 10000 # one PHASE of a run+# classify_timeout_ms = 180000 # ceiling for the WHOLE run (ORE's 180s)+# A run has five phases (consistency, satisfiability, subsumption, ABox,+# explanation), each opening one phase budget, so at these defaults the ceiling+# cannot be the bound that fires: 5 x 10000 = 50000, well under 180000. Lower it+# below that to make it the binding one. Every `owl-dl` run reports which of the+# two is binding, in `budget.binding_bound`, with a sentence saying why.# [feedback]# Lint / enforce self-calibration thresholds (number of dismissals beforediff --git a/src/runtime.rs b/src/runtime.rsindex efb782e7..87e2f9cf 100644--- a/src/runtime.rs+++ b/src/runtime.rs@@ -172,7 +172,11 @@ pub fn set_tableaux_test_timeout_ms(ms: usize) {/// fifty, which is less than a hundred and eighty. Making it the binding bound/// means minting a deadline per tableau rather than per phase, which was/// measured: a 20-ontology corpus went from 67s to over 600s with no verdict-/// changing. The engine therefore reports, in `budget.binding_bound` and+/// changing. That number is UNREPRODUCIBLE — its corpus is written down nowhere+/// and matches neither corpus in `tests/reasoner_budget_corpus_bench.rs`; see+/// `DlReasoner::phase_deadline`, which is the one place that says so, and the+/// bench, which is the one place that measures. The engine therefore reports, in+/// `budget.binding_bound` and/// `budget.note` on every `owl-dl` run, which of the two bounds actually stops/// the run — including "neither" — rather than leaving a reader to do this/// arithmetic from two settings and a phase count.diff --git a/src/tableaux.rs b/src/tableaux.rsindex 09cdd2c1..889f1b0c 100644--- a/src/tableaux.rs+++ b/src/tableaux.rs@@ -2387,6 +2387,15 @@ impl DlReasoner {/// `owl-dl` run now says so in its `budget` block rather than leaving a/// reader to infer it from two settings and a phase count.///+ /// THAT 67s NUMBER CANNOT BE REPRODUCED FROM THIS REPOSITORY and is kept only+ /// as the reason a route was abandoned. The corpus it was taken over is not+ /// written down anywhere: it is not the twenty case-study ontologies, which+ /// run in 0.10s and reach no budget at all, and it is not the ten hard ones,+ /// of which two reach a budget rather than five. Both of those ARE written+ /// down, in `tests/reasoner_budget_corpus_bench.rs`, which exists so that the+ /// next person to change a budget can measure rather than cite this+ /// paragraph. Cite the bench.+ ////// `classify_timeout_ms` is now a CEILING over every phase, not a fifth/// budget beside them: see `phase_deadline_within`, which is what every/// phase inside a run actually calls. A bare `phase_deadline` is for a@@ -2404,7 +2413,8 @@ impl DlReasoner {/// read, no extra branch — while making it impossible for any phase to/// outlive the global budget. The expensive half, minting a fresh budget per/// TABLEAU so that the global one is what eventually stops the sweep, is what- /// took the corpus from 67s to over 600s and is not what this does.+ /// took the corpus from 67s to over 600s (a number `phase_deadline` flags as+ /// unreproducible) and is not what this does.////// `None` on either side means "that one imposes nothing", so with the global/// budget switched off this is the phase budget unchanged, and with the phase@@ -3276,7 +3286,9 @@ impl DlReasoner {// a worst case of 50 000 ms, so the 180 000 ms ceiling is dead// arithmetic and cannot fire. Handing the global budget the run instead// means minting a deadline per TABLEAU, which was measured and took a- // 20-ontology corpus from 67s to over 600s, and was abandoned.+ // 20-ontology corpus from 67s to over 600s, and was abandoned. That+ // number is unreproducible from this tree; `phase_deadline` says why and+ // names the bench that is.//// What is left is the thing that was missing: SAYING SO. A knob that// reads as a safety limit may not enforce nothing, and the arithmetic@@ -4510,14 +4522,6 @@ impl DlReasoner {self.emit(&tableau, &HashMap::new(), axioms, dir)}- /// Certify that the TBox is consistent.- ///- /// No `nonempty` line is needed: `Dl.WellFormed` already requires the domain- /// to be non-empty, so a model of the axiom set alone is exactly what TBox- /// consistency asserts.- /// The named classes, in the interner's order, so a caller can certify each- /// one. `run` uses it because TBox consistency alone is witnessed by a- /// single point with empty extensions, which is honest and uninformative./// The internal id of a named class, by IRI, for callers that hold a name/// and need the id `explain_unsatisfiable` takes. Matches the spelling/// `named_class_names` returns, angle brackets and all, and also the bare@@ -4530,6 +4534,9 @@ impl DlReasoner {.find(|&id| self.interner.resolve(id).trim_start_matches('<').trim_end_matches('>') == bare)}+ /// The named classes, in the interner's order, so a caller can certify each+ /// one. `run` uses it because TBox consistency alone is witnessed by a+ /// single point with empty extensions, which is honest and uninformative.pub fn named_class_names(&self) -> Vec<String> {let mut v: Vec<String> = self.named_classes@@ -4594,6 +4601,18 @@ impl DlReasoner {found}+ /// Certify that the TBox is consistent.+ ///+ /// No `nonempty` line is needed: `Dl.WellFormed` already requires the domain+ /// to be non-empty, so a model of the axiom set alone is exactly what TBox+ /// consistency asserts.+ ///+ /// This paragraph was stranded: it sat above `named_class_names`, four+ /// hundred lines from the function it describes and joined to that+ /// function's own doc comment with no blank line, so `cargo doc` printed a+ /// block about certification to a reader of a method that returns a list of+ /// names, and this method was documented nowhere. It is back where it+ /// belongs.pub fn certify_tbox_consistent(&self, dir: &Path) -> anyhow::Result<ModelOutcome> {let mut tableau = Tableau::with_deadline(Arc::clone(&self.tbox), self.phase_deadline());tableau.capture = true;diff --git a/tests/reasoner_budget_corpus_bench.rs b/tests/reasoner_budget_corpus_bench.rsindex 23b915af..8750d318 100644--- a/tests/reasoner_budget_corpus_bench.rs+++ b/tests/reasoner_budget_corpus_bench.rs@@ -1,46 +1,68 @@//! What a change to the reasoner's budgets costs, measured rather than asserted.//!//! `src/tableaux.rs` carries a cost measurement in a doc comment — "a-//! 20-ontology corpus went from 67s to over 600s" — and until this file there-//! was no way to reproduce it. A number in a comment that nobody can re-run is a-//! number that goes stale silently, and the budget it justifies is exactly the-//! kind of setting that gets changed by someone who cannot check what it costs.+//! 20-ontology corpus went from 67s to over 600s" — over a corpus that is+//! written down NOWHERE, so it cannot be re-run and this file does not reproduce+//! it. It measures two corpora that ARE in the tree instead, neither of which is+//! that one: the twenty case studies reach no budget at all, and the ten hard+//! ones have two reaching one rather than five. A number in a comment that+//! nobody can re-run is a number that goes stale silently, and the budget it+//! justifies is exactly the kind of setting that gets changed by someone who+//! cannot check what it costs.//!-//! The corpus is fixed and is in the repository: every `*.ttl` under a-//! `case-studies/**/ontology/` directory, plus the two core ontologies that live-//! one level up, minus `occupational-map.ttl`, which is 5.7 MB and is already-//! excluded from the certificate corpus for the same reason. That is twenty-//! files.+//! TWO corpora, both fixed and both in the repository. `CORPUS` is every `*.ttl`+//! under a `case-studies/**/ontology/` directory, plus the two core ontologies+//! that live one level up, minus `occupational-map.ttl`, which is 5.7 MB and is+//! already excluded from the certificate corpus for the same reason: twenty+//! files, none of which reaches a budget. `HARD` is ten from `benchmark/` that+//! cost something, two of which exhaust one. Both are needed, and the reason is+//! in the comment on `HARD`.//!//! IGNORED by default, because it takes minutes and measures wall clock, which//! is not a thing an assertion should be built on. Run it deliberately://!//! ```text-//! cargo test --release --test reasoner_budget_corpus_bench -- --ignored --nocapture+//! cargo test --test reasoner_budget_corpus_bench -- --ignored --nocapture//! ```//!+//! The numbers below are from THAT command, the debug profile, because that is+//! what `cargo test` runs and comparing a debug total against a release total+//! measures the optimiser. Add `--release` if you want to, and then compare only+//! release against release.+//!//! It prints per-ontology wall time, the phases that ran out of budget, and the//! total. Compare two totals; do not compare a total against a number in a//! comment written on a different machine.//!-//! MEASURED, 14 September 2026, `cargo test` debug profile, this machine,-//! running the two builds back to back so they share whatever load the machine-//! was under — which matters more than it sounds: an earlier pair of runs-//! differed by a factor of four purely because a release build was competing-//! with one of them. The change under test is `phase_deadline_within`, which-//! puts every phase under the `classify_timeout_ms` ceiling, plus the widening-//! of definition realization to untyped individuals.+//! MEASURED, 15 September 2026, `cargo test` debug profile, this machine,+//! alternating the two builds so they share whatever load the machine was under+//! — which matters more than it sounds: an earlier pair of runs differed by a+//! factor of four purely because a release build was competing with one of them.+//! The change under test is `phase_deadline_within`, which puts every phase+//! under the `classify_timeout_ms` ceiling, plus the widening of definition+//! realization to untyped individuals.+//!+//! THREE RUNS OF EACH BUILD, not one, because one run of each cannot tell a cost+//! from the machine://!//! | corpus | before | after |//! |---|---|---|-//! | twenty case-study ontologies, none reaching a budget | 0.10s | 0.10s |-//! | ten that do, two of them exhausting one | 64.53s | 63.84s |+//! | twenty case-study ontologies, none reaching a budget | 0.33 / 0.09 / 0.09s | 0.10 / 0.34 / 0.08s |+//! | ten that do, two of them exhausting one | 62.42 / 62.78 / 65.10s | 63.75 / 62.62 / 64.55s |+//!+//! Unchanged: the "after" range lies inside the "before" range on both corpora,+//! and the spread between two runs of the SAME build is larger than any gap+//! between the builds. It also has to be unchanged, which is why three runs are+//! enough to believe it: at the shipped settings+//! `min(now + 10 000 ms, now + 180 000 ms)` is the same instant the phase budget+//! alone produced, so the intersection is five `Option` comparisons per run and+//! not work. The difference shows up only when `classify_timeout_ms` is set+//! below five times `tableaux_test_timeout_ms`, which is when it is meant to.//!-//! Unchanged, and it has to be: at the shipped settings-//! `min(now + 10 000 ms, now + 180 000 ms)` is the same instant the phase-//! budget alone produced, so the intersection is arithmetic and not work. The-//! difference shows up only when `classify_timeout_ms` is set below five times-//! `tableaux_test_timeout_ms`, which is when it is meant to.+//! Do not quote a single pair from this table as "the" number. The two 30-second+//! rows are clock-bound and identical by construction; everything that can move+//! is in the other eight, which total under two seconds, so a 1-second gap+//! between two totals is the machine and not the code.mod common;@@ -52,9 +74,9 @@ use open_ontologies::reason::Reasoner;/// The ontologies in this repository that actually exhaust a reasoner budget.///-/// The case-study corpus below is broad and EASY: measured here it runs in under-/// three seconds and not one of the twenty hits a cap, so a change to the budget-/// logic is invisible in it. A cost measurement over a corpus that never reaches+/// The case-study corpus below is broad and EASY: measured here it runs in about+/// a tenth of a second and not one of the twenty hits a cap, so a change to the+/// budget logic is invisible in it. A cost measurement over a corpus that never reaches/// the thing being measured is the shape of number this project exists to/// refuse, so this second list exists and is the one that answers the question./// `nominals_blowup.ttl` is in `benchmark/reasoner/regressions/` for exactly thisdiff --git a/tests/reasoner_global_budget_test.rs b/tests/reasoner_global_budget_test.rsindex caf08732..2849adf3 100644--- a/tests/reasoner_global_budget_test.rs+++ b/tests/reasoner_global_budget_test.rs@@ -6,12 +6,16 @@//!//! 1. **It could not fire.** Each phase of a classification opens its own//! deadline from `tableaux_test_timeout_ms`, which defaults to 10 000 ms.-//! Four phases — consistency, satisfiability, subsumption, ABox — is a-//! worst case of 40 000 ms, so a 180 000 ms global deadline is dead-//! arithmetic. An earlier attempt to fix this by minting a deadline per+//! Four phases had one — consistency, satisfiability, subsumption, ABox —+//! for a worst case of 40 000 ms, so a 180 000 ms global deadline was dead+//! arithmetic. Explanation is the fifth and had no clock at all, which is+//! point 2 below; with it under the same budget the worst case is 50 000 ms+//! and the ceiling is still dead arithmetic, which is what the run now says+//! in words. An earlier attempt to fix this by minting a deadline per//! TABLEAU did hand the global budget the run, and took a 20-ontology//! corpus from 67s to over 600s. It was abandoned, correctly, and the knob-//! stayed.+//! stayed. (That 67s is unreproducible — its corpus was never written down.+//! `tests/reasoner_budget_corpus_bench.rs` pins two that were.)//! 2. **It did not cover the run.** `classify_timeout_ms` was read inside//! `classify_parallel` and nowhere else, so the TBox consistency check//! before it, the ABox check after it and the explanation loop after that@@ -210,11 +214,20 @@ fn the_classification_budget_bounds_the_run_or_the_run_says_it_does_not() {// all: `apply_reasoner` wrote the depth cap, the node cap and the// iteration cap and touched neither clock. Three comments in// `src/tableaux.rs` referred to "`[reasoner] classify_timeout_ms`" as- // though it were a setting. The only ways to move either were the- // `--reason-timeout-ms` flag, which moves the per-test one only, and- // the setters above, which exist for tests. A ceiling nobody can lower- // is the strongest form of a limit that enforces nothing, and the note- // this run now prints tells a reader to lower it.+ // though it were a setting. The only way to move either was the pair+ // of setters above, which exist for tests — and the phase one was+ // documented as "used by the CLI `--reason-timeout-ms` flag", which+ // does not exist: grepping the whole tree for that string returned one+ // hit, the sentence claiming it. A ceiling nobody can lower is the+ // strongest form of a limit that enforces nothing, and the note this+ // run now prints tells a reader to lower it.+ //+ // Worse than an unreachable key: `Config` does not deny unknown+ // fields, so a user who wrote `classify_timeout_ms = 30000` in+ // `config.toml` got a clean parse, no warning, and no effect. That is+ // what the assertions below would have caught, and did: run this test+ // against the pre-fix engine and `classify_timeout_ms()` comes back+ // holding whatever the previous line set, not 4321.let toml = r#"[reasoner]classify_timeout_ms = 4321