universal-physics-tensor 0.45.2 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -27
- package/dist/atlas/applicability.d.ts +108 -0
- package/dist/atlas/applicability.d.ts.map +1 -0
- package/dist/atlas/applicability.js +301 -0
- package/dist/atlas/applicability.js.map +1 -0
- package/dist/atlas/association.d.ts +92 -0
- package/dist/atlas/association.d.ts.map +1 -0
- package/dist/atlas/association.js +112 -0
- package/dist/atlas/association.js.map +1 -0
- package/dist/atlas/benchmark/backend-shapes.d.ts +47 -0
- package/dist/atlas/benchmark/backend-shapes.d.ts.map +1 -0
- package/dist/atlas/benchmark/backend-shapes.js +58 -0
- package/dist/atlas/benchmark/backend-shapes.js.map +1 -0
- package/dist/atlas/benchmark/baselines.d.ts +64 -0
- package/dist/atlas/benchmark/baselines.d.ts.map +1 -0
- package/dist/atlas/benchmark/baselines.js +112 -0
- package/dist/atlas/benchmark/baselines.js.map +1 -0
- package/dist/atlas/benchmark/leakage.d.ts +56 -0
- package/dist/atlas/benchmark/leakage.d.ts.map +1 -0
- package/dist/atlas/benchmark/leakage.js +100 -0
- package/dist/atlas/benchmark/leakage.js.map +1 -0
- package/dist/atlas/benchmark/loader.d.ts +56 -0
- package/dist/atlas/benchmark/loader.d.ts.map +1 -0
- package/dist/atlas/benchmark/loader.js +104 -0
- package/dist/atlas/benchmark/loader.js.map +1 -0
- package/dist/atlas/benchmark/run-atlas.d.ts +72 -0
- package/dist/atlas/benchmark/run-atlas.d.ts.map +1 -0
- package/dist/atlas/benchmark/run-atlas.js +210 -0
- package/dist/atlas/benchmark/run-atlas.js.map +1 -0
- package/dist/atlas/benchmark/stats.d.ts +90 -0
- package/dist/atlas/benchmark/stats.d.ts.map +1 -0
- package/dist/atlas/benchmark/stats.js +159 -0
- package/dist/atlas/benchmark/stats.js.map +1 -0
- package/dist/atlas/benchmark/study.d.ts +120 -0
- package/dist/atlas/benchmark/study.d.ts.map +1 -0
- package/dist/atlas/benchmark/study.js +192 -0
- package/dist/atlas/benchmark/study.js.map +1 -0
- package/dist/atlas/benchmark/types.d.ts +79 -0
- package/dist/atlas/benchmark/types.d.ts.map +1 -0
- package/dist/atlas/benchmark/types.js +46 -0
- package/dist/atlas/benchmark/types.js.map +1 -0
- package/dist/atlas/composition-table.d.ts +55 -0
- package/dist/atlas/composition-table.d.ts.map +1 -0
- package/dist/atlas/composition-table.js +133 -0
- package/dist/atlas/composition-table.js.map +1 -0
- package/dist/atlas/conventions.d.ts +63 -0
- package/dist/atlas/conventions.d.ts.map +1 -0
- package/dist/atlas/conventions.js +93 -0
- package/dist/atlas/conventions.js.map +1 -0
- package/dist/atlas/coverage.d.ts +93 -0
- package/dist/atlas/coverage.d.ts.map +1 -0
- package/dist/atlas/coverage.js +69 -0
- package/dist/atlas/coverage.js.map +1 -0
- package/dist/atlas/derivation.d.ts +137 -0
- package/dist/atlas/derivation.d.ts.map +1 -0
- package/dist/atlas/derivation.js +190 -0
- package/dist/atlas/derivation.js.map +1 -0
- package/dist/atlas/derive-evidence.d.ts +218 -0
- package/dist/atlas/derive-evidence.d.ts.map +1 -0
- package/dist/atlas/derive-evidence.js +225 -0
- package/dist/atlas/derive-evidence.js.map +1 -0
- package/dist/atlas/diffusion/bridges-closure.d.ts +63 -0
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -0
- package/dist/atlas/diffusion/bridges-closure.js +324 -0
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -0
- package/dist/atlas/diffusion/bridges.d.ts +36 -0
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -0
- package/dist/atlas/diffusion/bridges.js +226 -0
- package/dist/atlas/diffusion/bridges.js.map +1 -0
- package/dist/atlas/diffusion/dimensions.d.ts +21 -0
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -0
- package/dist/atlas/diffusion/dimensions.js +21 -0
- package/dist/atlas/diffusion/dimensions.js.map +1 -0
- package/dist/atlas/diffusion/index.d.ts +16 -0
- package/dist/atlas/diffusion/index.d.ts.map +1 -0
- package/dist/atlas/diffusion/index.js +23 -0
- package/dist/atlas/diffusion/index.js.map +1 -0
- package/dist/atlas/diffusion/models.d.ts +24 -0
- package/dist/atlas/diffusion/models.d.ts.map +1 -0
- package/dist/atlas/diffusion/models.js +139 -0
- package/dist/atlas/diffusion/models.js.map +1 -0
- package/dist/atlas/diffusion/numerics.d.ts +181 -0
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -0
- package/dist/atlas/diffusion/numerics.js +251 -0
- package/dist/atlas/diffusion/numerics.js.map +1 -0
- package/dist/atlas/error-algebra.d.ts +52 -0
- package/dist/atlas/error-algebra.d.ts.map +1 -0
- package/dist/atlas/error-algebra.js +55 -0
- package/dist/atlas/error-algebra.js.map +1 -0
- package/dist/atlas/export.d.ts +48 -0
- package/dist/atlas/export.d.ts.map +1 -0
- package/dist/atlas/export.js +106 -0
- package/dist/atlas/export.js.map +1 -0
- package/dist/atlas/families.d.ts +14 -0
- package/dist/atlas/families.d.ts.map +1 -0
- package/dist/atlas/families.js +20 -0
- package/dist/atlas/families.js.map +1 -0
- package/dist/atlas/index.d.ts +90 -0
- package/dist/atlas/index.d.ts.map +1 -0
- package/dist/atlas/index.js +69 -0
- package/dist/atlas/index.js.map +1 -0
- package/dist/atlas/link-prediction.d.ts +71 -0
- package/dist/atlas/link-prediction.d.ts.map +1 -0
- package/dist/atlas/link-prediction.js +128 -0
- package/dist/atlas/link-prediction.js.map +1 -0
- package/dist/atlas/model.d.ts +70 -0
- package/dist/atlas/model.d.ts.map +1 -0
- package/dist/atlas/model.js +26 -0
- package/dist/atlas/model.js.map +1 -0
- package/dist/atlas/oscillators/bridges-coarse.d.ts +71 -0
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -0
- package/dist/atlas/oscillators/bridges-coarse.js +146 -0
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -0
- package/dist/atlas/oscillators/bridges-exact.d.ts +70 -0
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -0
- package/dist/atlas/oscillators/bridges-exact.js +227 -0
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -0
- package/dist/atlas/oscillators/bridges-limits.d.ts +118 -0
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -0
- package/dist/atlas/oscillators/bridges-limits.js +342 -0
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -0
- package/dist/atlas/oscillators/dimensions.d.ts +34 -0
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -0
- package/dist/atlas/oscillators/dimensions.js +34 -0
- package/dist/atlas/oscillators/dimensions.js.map +1 -0
- package/dist/atlas/oscillators/index.d.ts +38 -0
- package/dist/atlas/oscillators/index.d.ts.map +1 -0
- package/dist/atlas/oscillators/index.js +37 -0
- package/dist/atlas/oscillators/index.js.map +1 -0
- package/dist/atlas/oscillators/models.d.ts +25 -0
- package/dist/atlas/oscillators/models.d.ts.map +1 -0
- package/dist/atlas/oscillators/models.js +160 -0
- package/dist/atlas/oscillators/models.js.map +1 -0
- package/dist/atlas/oscillators/rejections.d.ts +21 -0
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -0
- package/dist/atlas/oscillators/rejections.js +54 -0
- package/dist/atlas/oscillators/rejections.js.map +1 -0
- package/dist/atlas/path-bound.d.ts +143 -0
- package/dist/atlas/path-bound.d.ts.map +1 -0
- package/dist/atlas/path-bound.js +268 -0
- package/dist/atlas/path-bound.js.map +1 -0
- package/dist/atlas/poster/associations.d.ts +66 -0
- package/dist/atlas/poster/associations.d.ts.map +1 -0
- package/dist/atlas/poster/associations.js +90 -0
- package/dist/atlas/poster/associations.js.map +1 -0
- package/dist/atlas/poster/derivations.d.ts +156 -0
- package/dist/atlas/poster/derivations.d.ts.map +1 -0
- package/dist/atlas/poster/derivations.js +430 -0
- package/dist/atlas/poster/derivations.js.map +1 -0
- package/dist/atlas/poster/statements.d.ts +198 -0
- package/dist/atlas/poster/statements.d.ts.map +1 -0
- package/dist/atlas/poster/statements.js +365 -0
- package/dist/atlas/poster/statements.js.map +1 -0
- package/dist/atlas/public.d.ts +26 -0
- package/dist/atlas/public.d.ts.map +1 -0
- package/dist/atlas/public.js +21 -0
- package/dist/atlas/public.js.map +1 -0
- package/dist/atlas/regime.d.ts +171 -0
- package/dist/atlas/regime.d.ts.map +1 -0
- package/dist/atlas/regime.js +309 -0
- package/dist/atlas/regime.js.map +1 -0
- package/dist/atlas/serialize.d.ts +50 -0
- package/dist/atlas/serialize.d.ts.map +1 -0
- package/dist/atlas/serialize.js +180 -0
- package/dist/atlas/serialize.js.map +1 -0
- package/dist/atlas/statement.d.ts +165 -0
- package/dist/atlas/statement.d.ts.map +1 -0
- package/dist/atlas/statement.js +176 -0
- package/dist/atlas/statement.js.map +1 -0
- package/dist/atlas/types.d.ts +308 -0
- package/dist/atlas/types.d.ts.map +1 -0
- package/dist/atlas/types.js +61 -0
- package/dist/atlas/types.js.map +1 -0
- package/dist/atlas/waves/bridges-closure.d.ts +39 -0
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -0
- package/dist/atlas/waves/bridges-closure.js +223 -0
- package/dist/atlas/waves/bridges-closure.js.map +1 -0
- package/dist/atlas/waves/bridges.d.ts +49 -0
- package/dist/atlas/waves/bridges.d.ts.map +1 -0
- package/dist/atlas/waves/bridges.js +265 -0
- package/dist/atlas/waves/bridges.js.map +1 -0
- package/dist/atlas/waves/index.d.ts +16 -0
- package/dist/atlas/waves/index.d.ts.map +1 -0
- package/dist/atlas/waves/index.js +23 -0
- package/dist/atlas/waves/index.js.map +1 -0
- package/dist/atlas/waves/models.d.ts +29 -0
- package/dist/atlas/waves/models.d.ts.map +1 -0
- package/dist/atlas/waves/models.js +127 -0
- package/dist/atlas/waves/models.js.map +1 -0
- package/dist/atlas/waves/numerics.d.ts +149 -0
- package/dist/atlas/waves/numerics.d.ts.map +1 -0
- package/dist/atlas/waves/numerics.js +218 -0
- package/dist/atlas/waves/numerics.js.map +1 -0
- package/dist/atlas/witness-artifact.d.ts +65 -0
- package/dist/atlas/witness-artifact.d.ts.map +1 -0
- package/dist/atlas/witness-artifact.js +78 -0
- package/dist/atlas/witness-artifact.js.map +1 -0
- package/dist/atlas/witness-numeric.d.ts +81 -0
- package/dist/atlas/witness-numeric.d.ts.map +1 -0
- package/dist/atlas/witness-numeric.js +105 -0
- package/dist/atlas/witness-numeric.js.map +1 -0
- package/dist/atlas/witness-result.d.ts +77 -0
- package/dist/atlas/witness-result.d.ts.map +1 -0
- package/dist/atlas/witness-result.js +39 -0
- package/dist/atlas/witness-result.js.map +1 -0
- package/dist/atlas/witness-specs.d.ts +110 -0
- package/dist/atlas/witness-specs.d.ts.map +1 -0
- package/dist/atlas/witness-specs.js +372 -0
- package/dist/atlas/witness-specs.js.map +1 -0
- package/dist/atlas/witness-symbolic.d.ts +79 -0
- package/dist/atlas/witness-symbolic.d.ts.map +1 -0
- package/dist/atlas/witness-symbolic.js +140 -0
- package/dist/atlas/witness-symbolic.js.map +1 -0
- package/dist/atlas/witnesses/quantum-support.d.ts +50 -0
- package/dist/atlas/witnesses/quantum-support.d.ts.map +1 -0
- package/dist/atlas/witnesses/quantum-support.js +48 -0
- package/dist/atlas/witnesses/quantum-support.js.map +1 -0
- package/dist/bridges/be11-decoherence-confrontation.js.map +1 -1
- package/dist/bridges/be21-kss-confrontation.js.map +1 -1
- package/dist/bridges/be23-planckian-confrontation.js.map +1 -1
- package/dist/bridges/be35-bootstrap-confrontation.js.map +1 -1
- package/dist/bridges/be36-gw170817-confrontation.js.map +1 -1
- package/dist/bridges/be37-cassini-confrontation.js.map +1 -1
- package/dist/bridges/be48-collapse-confrontation.js.map +1 -1
- package/dist/bridges/be51-lensing-confrontation.js.map +1 -1
- package/dist/bridges/be52-mercury-confrontation.js.map +1 -1
- package/dist/bridges/be55-quantum-hall-confrontation.js.map +1 -1
- package/dist/bridges/be56-casimir-confrontation.js.map +1 -1
- package/dist/bridges/be58-johnson-nyquist-confrontation.js.map +1 -1
- package/dist/bridges/be59-ac-josephson-confrontation.js.map +1 -1
- package/dist/bridges/be60-fractional-qh-confrontation.js.map +1 -1
- package/dist/bridges/be61-wiedemann-franz-confrontation.js.map +1 -1
- package/dist/bridges/be62-bcs-gap-confrontation.js.map +1 -1
- package/dist/bridges/be63-chandrasekhar-mass-confrontation.js.map +1 -1
- package/dist/bridges/be64-eddington-luminosity-confrontation.js.map +1 -1
- package/dist/bridges/be65-jeans-mass-confrontation.js.map +1 -1
- package/dist/bridges/bridge-equations.d.ts +2 -1
- package/dist/bridges/bridge-equations.d.ts.map +1 -1
- package/dist/bridges/bridge-equations.js +3 -2
- package/dist/bridges/bridge-equations.js.map +1 -1
- package/dist/bridges/catalog-adapter.d.ts.map +1 -1
- package/dist/bridges/catalog-adapter.js.map +1 -1
- package/dist/bridges/equations/_be-helpers.d.ts +2 -2
- package/dist/bridges/equations/_be-helpers.js +2 -2
- package/dist/bridges/equations/be-20-vacuum-energy.js.map +1 -1
- package/dist/bridges/equations/be-35-conformal-bootstrap.d.ts +88 -58
- package/dist/bridges/equations/be-35-conformal-bootstrap.d.ts.map +1 -1
- package/dist/bridges/equations/be-35-conformal-bootstrap.js +102 -62
- package/dist/bridges/equations/be-35-conformal-bootstrap.js.map +1 -1
- package/dist/bridges/equations/be-48-grw-localization.d.ts +9 -8
- package/dist/bridges/equations/be-48-grw-localization.d.ts.map +1 -1
- package/dist/bridges/equations/be-48-grw-localization.js +9 -8
- package/dist/bridges/equations/be-48-grw-localization.js.map +1 -1
- package/dist/bridges/gravitational-lensing.d.ts +10 -0
- package/dist/bridges/gravitational-lensing.d.ts.map +1 -1
- package/dist/bridges/gravitational-lensing.js.map +1 -1
- package/dist/bridges/index.d.ts +125 -7
- package/dist/bridges/index.d.ts.map +1 -1
- package/dist/bridges/index.js +483 -20
- package/dist/bridges/index.js.map +1 -1
- package/dist/bridges/perihelion-precession.d.ts +10 -0
- package/dist/bridges/perihelion-precession.d.ts.map +1 -1
- package/dist/bridges/perihelion-precession.js.map +1 -1
- package/dist/bridges/rhs-registry.js +2 -2
- package/dist/canonical/canonical-equation.d.ts +15 -0
- package/dist/canonical/canonical-equation.d.ts.map +1 -1
- package/dist/canonical/entries/_l1-build.d.ts +1 -1
- package/dist/canonical/entries/_l1-build.d.ts.map +1 -1
- package/dist/canonical/entries/atomic.d.ts.map +1 -1
- package/dist/canonical/entries/atomic.js +23 -0
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +93 -0
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/residual.d.ts +28 -0
- package/dist/canonical/residual.d.ts.map +1 -0
- package/dist/canonical/residual.js +31 -0
- package/dist/canonical/residual.js.map +1 -0
- package/dist/cli/command.d.ts +8 -0
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js +10 -0
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts +3 -0
- package/dist/cli/commands/atlas.d.ts.map +1 -0
- package/dist/cli/commands/atlas.js +158 -0
- package/dist/cli/commands/atlas.js.map +1 -0
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/coverage.js +3 -3
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +3 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +161 -27
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/path.d.ts +3 -0
- package/dist/cli/commands/path.d.ts.map +1 -0
- package/dist/cli/commands/path.js +145 -0
- package/dist/cli/commands/path.js.map +1 -0
- package/dist/cli/commands/recover.d.ts.map +1 -1
- package/dist/cli/commands/recover.js +25 -6
- package/dist/cli/commands/recover.js.map +1 -1
- package/dist/cli/commands/regime.d.ts +14 -0
- package/dist/cli/commands/regime.d.ts.map +1 -0
- package/dist/cli/commands/regime.js +189 -0
- package/dist/cli/commands/regime.js.map +1 -0
- package/dist/cli/errors.d.ts.map +1 -1
- package/dist/cli/graphs.d.ts.map +1 -1
- package/dist/cli/graphs.js +5 -1
- package/dist/cli/graphs.js.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +22 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/output.d.ts +6 -1
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +16 -0
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +18 -0
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-prediction.d.ts.map +1 -1
- package/dist/composition/bridge-prediction.js +0 -0
- package/dist/composition/bridge-prediction.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +2 -2
- package/dist/composition/canonical-graph.js +2 -2
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +80 -1
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/consequence.js.map +1 -1
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +64 -0
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +29 -0
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/edges/calibration.d.ts.map +1 -1
- package/dist/composition/edges/calibration.js +46 -0
- package/dist/composition/edges/calibration.js.map +1 -1
- package/dist/composition/edges/catalog-quantum.d.ts.map +1 -1
- package/dist/composition/edges/catalog-quantum.js +9 -0
- package/dist/composition/edges/catalog-quantum.js.map +1 -1
- package/dist/composition/edges/catalog-tranche.d.ts.map +1 -1
- package/dist/composition/edges/catalog-tranche.js +18 -0
- package/dist/composition/edges/catalog-tranche.js.map +1 -1
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +13 -0
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +25 -0
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/expr-subst.js.map +1 -1
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz.d.ts +118 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +189 -6
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +4 -2
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +2 -1
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/poster-source.d.ts +153 -0
- package/dist/composition/poster-source.d.ts.map +1 -0
- package/dist/composition/poster-source.js +183 -0
- package/dist/composition/poster-source.js.map +1 -0
- package/dist/composition/probe/backend-protocol.d.ts +34 -1
- package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
- package/dist/composition/probe/backend-protocol.js +9 -2
- package/dist/composition/probe/backend-protocol.js.map +1 -1
- package/dist/composition/probe/candidate-store.d.ts.map +1 -1
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/search-budget.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +2 -2
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +1 -1
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/uncertainty.d.ts +52 -2
- package/dist/composition/uncertainty.d.ts.map +1 -1
- package/dist/composition/uncertainty.js +38 -2
- package/dist/composition/uncertainty.js.map +1 -1
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/core/flux-rules.d.ts.map +1 -1
- package/dist/core/flux-rules.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/regime-registry.d.ts.map +1 -1
- package/dist/core/regime-rule-install.js.map +1 -1
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/diff/bridge-ast-gradient.js.map +1 -1
- package/dist/dimensional/ast-types.d.ts +31 -1
- package/dist/dimensional/ast-types.d.ts.map +1 -1
- package/dist/dimensional/bridge-check.d.ts +1 -1
- package/dist/dimensional/bridge-check.js +1 -1
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/connection.d.ts +2 -0
- package/dist/dimensional/connection.d.ts.map +1 -1
- package/dist/dimensional/connection.js +2 -0
- package/dist/dimensional/connection.js.map +1 -1
- package/dist/dimensional/curvature-composite.d.ts +5 -3
- package/dist/dimensional/curvature-composite.d.ts.map +1 -1
- package/dist/dimensional/curvature-composite.js +1 -0
- package/dist/dimensional/curvature-composite.js.map +1 -1
- package/dist/dimensional/curvature-invariants.d.ts +2 -0
- package/dist/dimensional/curvature-invariants.d.ts.map +1 -1
- package/dist/dimensional/curvature-invariants.js +2 -0
- package/dist/dimensional/curvature-invariants.js.map +1 -1
- package/dist/dimensional/dimension-spec.d.ts.map +1 -1
- package/dist/dimensional/einstein-equation.d.ts +3 -3
- package/dist/dimensional/einstein-equation.js +3 -3
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/metric.d.ts +5 -2
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +5 -2
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/tensor-trace.js.map +1 -1
- package/dist/dimensional/validator-registry.js.map +1 -1
- package/dist/dimensional/validator.d.ts +3 -2
- package/dist/dimensional/validator.d.ts.map +1 -1
- package/dist/dimensional/validator.js +23 -4
- package/dist/dimensional/validator.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +104 -0
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/float64-engine.d.ts.map +1 -1
- package/dist/numerical/float64-engine.js +51 -24
- package/dist/numerical/float64-engine.js.map +1 -1
- package/dist/numerical/formula-dimension.d.ts.map +1 -1
- package/dist/numerical/formula-dimension.js.map +1 -1
- package/dist/numerical/formula.d.ts.map +1 -1
- package/dist/numerical/formula.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/gl4-integrator.d.ts +3 -3
- package/dist/numerical/gl4-integrator.js +3 -3
- package/dist/numerical/killing.d.ts +47 -5
- package/dist/numerical/killing.d.ts.map +1 -1
- package/dist/numerical/killing.js +41 -3
- package/dist/numerical/killing.js.map +1 -1
- package/dist/numerical/klein-gordon.d.ts +2 -2
- package/dist/numerical/klein-gordon.js +2 -2
- package/dist/numerical/lowering.d.ts +2 -2
- package/dist/numerical/lowering.d.ts.map +1 -1
- package/dist/numerical/lowering.js +5 -3
- package/dist/numerical/lowering.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +15 -13
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +15 -13
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/weyl-lowering.d.ts.map +1 -1
- package/dist/numerical/weyl-lowering.js +90 -40
- package/dist/numerical/weyl-lowering.js.map +1 -1
- package/package.json +121 -104
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/atlas/benchmark/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,WAAW,EAAE,CA0B7F;AAED,kFAAkF;AAClF,qBAAa,uBAAwB,SAAQ,KAAK;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE;IAArD,YAAqB,QAAQ,EAAE,SAAS,WAAW,EAAE,EAMpD;CACF;AAQD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,EAAE,CAKrE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,EAAE,CAKzE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas Phase 5, S5.1 — load and validate benchmark items.
|
|
3
|
+
*
|
|
4
|
+
* Design note: `docs/planning/Atlas-Phase-5-Design.md` §0, §2.
|
|
5
|
+
*
|
|
6
|
+
* This module reads the PUBLIC half of a benchmark directory and nothing else.
|
|
7
|
+
* The answers live in a sibling half that no `src/` file may read;
|
|
8
|
+
* `tests/atlas/benchmark.test.ts` holds the import guard, with a positive
|
|
9
|
+
* control proving the guard can fire.
|
|
10
|
+
*
|
|
11
|
+
* **The loader enforces the one part of the independence rule that code CAN
|
|
12
|
+
* enforce: a frozen item whose `authorship` is not `'independent'` is refused.**
|
|
13
|
+
* Whether the author really was independent is a fact about people, recorded in
|
|
14
|
+
* the pre-registration note and checked by review.
|
|
15
|
+
*
|
|
16
|
+
* @module atlas/benchmark/loader
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
import { readFileSync } from 'node:fs';
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
import { HELD_OUT_FAMILY } from './types.js';
|
|
22
|
+
/**
|
|
23
|
+
* Validate an item set against the schema and the rules that make it a benchmark.
|
|
24
|
+
*
|
|
25
|
+
* @param items - the items, as parsed.
|
|
26
|
+
* @param frozen - true for the frozen set (authorship must be `'independent'`),
|
|
27
|
+
* false for the contested staging area (authorship must be `'contested-draft'`).
|
|
28
|
+
* @returns every problem found; empty means admissible. Never throws, so a
|
|
29
|
+
* caller sees ALL problems at once rather than the first.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export function validateItems(items, frozen) {
|
|
33
|
+
const problems = [];
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
for (const item of items) {
|
|
36
|
+
const p = (problem) => {
|
|
37
|
+
problems.push({ id: item.id, problem });
|
|
38
|
+
};
|
|
39
|
+
if (seen.has(item.id))
|
|
40
|
+
p('duplicate id');
|
|
41
|
+
seen.add(item.id);
|
|
42
|
+
const wanted = frozen ? 'independent' : 'contested-draft';
|
|
43
|
+
if (item.authorship !== wanted) {
|
|
44
|
+
p(`authorship '${item.authorship}' where the ${frozen ? 'frozen' : 'contested'} set requires '${wanted}'`);
|
|
45
|
+
}
|
|
46
|
+
// The answer lives in the scorer half. A public item that carries it would
|
|
47
|
+
// hand the key to any condition that reads the public file.
|
|
48
|
+
if ('kind' in item || 'failureKind' in item) {
|
|
49
|
+
p('the public half carries the answer (kind/failureKind); it belongs in scorer/labels.json');
|
|
50
|
+
}
|
|
51
|
+
if ((item.family === HELD_OUT_FAMILY) !== (item.split === 'held-out')) {
|
|
52
|
+
p(`the held-out split is exactly the '${HELD_OUT_FAMILY}' family; got family '${item.family}' in split '${item.split}'`);
|
|
53
|
+
}
|
|
54
|
+
if (item.premises.length === 0)
|
|
55
|
+
p('no premises');
|
|
56
|
+
if (item.source.trim() === '')
|
|
57
|
+
p('no source');
|
|
58
|
+
}
|
|
59
|
+
return problems;
|
|
60
|
+
}
|
|
61
|
+
/** Thrown when a benchmark directory holds an inadmissible item set. @internal */
|
|
62
|
+
export class BenchmarkAdmissionError extends Error {
|
|
63
|
+
problems;
|
|
64
|
+
constructor(problems) {
|
|
65
|
+
super(`benchmark items are not admissible: ${problems
|
|
66
|
+
.map((p) => `${p.id}: ${p.problem}`)
|
|
67
|
+
.join('; ')}`);
|
|
68
|
+
this.problems = problems;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function readItems(file) {
|
|
72
|
+
const parsed = JSON.parse(readFileSync(file, 'utf-8'));
|
|
73
|
+
if (!Array.isArray(parsed))
|
|
74
|
+
throw new Error(`${file}: expected a JSON array of items`);
|
|
75
|
+
return parsed;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Load the FROZEN items from `<benchmarkDir>/public/items.json`.
|
|
79
|
+
*
|
|
80
|
+
* @throws BenchmarkAdmissionError when any item is inadmissible — a frozen set
|
|
81
|
+
* with one contested draft in it is not a smaller benchmark, it is a broken one.
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export function loadFrozenItems(benchmarkDir) {
|
|
85
|
+
const items = readItems(join(benchmarkDir, 'public', 'items.json'));
|
|
86
|
+
const problems = validateItems(items, true);
|
|
87
|
+
if (problems.length > 0)
|
|
88
|
+
throw new BenchmarkAdmissionError(problems);
|
|
89
|
+
return items;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Load the CONTESTED drafts from `<benchmarkDir>/contested/items.json`. These are
|
|
93
|
+
* never scored; they wait for an independent author to accept or rewrite them.
|
|
94
|
+
*
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
export function loadContestedDrafts(benchmarkDir) {
|
|
98
|
+
const items = readItems(join(benchmarkDir, 'contested', 'items.json'));
|
|
99
|
+
const problems = validateItems(items, false);
|
|
100
|
+
if (problems.length > 0)
|
|
101
|
+
throw new BenchmarkAdmissionError(problems);
|
|
102
|
+
return items;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/atlas/benchmark/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAS7C;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAA+B,EAAE,MAAe;IAC5E,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,OAAe,EAAQ,EAAE;YAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAC1C,CAAC,CAAC;QACF,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,CAAC,CAAC,cAAc,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAElB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAC1D,IAAI,IAAI,CAAC,UAAU,KAAK,MA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,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,kCAAkC,CAAC,CAAC;IACvF,OAAO,MAAyB,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,YAAoB;IAClD,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAoB;IACtD,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas Phase 5, S5.2 — the ATLAS condition of the invalid-bridge benchmark.
|
|
3
|
+
*
|
|
4
|
+
* Design note: `docs/planning/Atlas-Phase-5-Design.md` §6.
|
|
5
|
+
*
|
|
6
|
+
* For each item the runner applies three atlas instruments — the applicability
|
|
7
|
+
* checker (S4.1), the composition table (S3) and the regime check (S2) — and
|
|
8
|
+
* emits `accept`, `reject` or `abstain`.
|
|
9
|
+
*
|
|
10
|
+
* ## The decision rule, and why accept is the HARDEST outcome to reach
|
|
11
|
+
*
|
|
12
|
+
* - **reject** when an instrument DEMONSTRABLY fires: a blocking applicability
|
|
13
|
+
* finding, a chain OVERCLAIMED as an exact equivalence, a structural analogy
|
|
14
|
+
* promoted to an equivalence, or a regime inequality checked and violated.
|
|
15
|
+
* - **accept** only when EVERY ENABLED instrument RAN and CLEARED: side conditions were
|
|
16
|
+
* stated, the applicability checker found nothing, the regime was supplied and
|
|
17
|
+
* every inequality was checked and held, and any claimed chain agrees with the
|
|
18
|
+
* table. At least one instrument must have RUN: an item that no enabled
|
|
19
|
+
* instrument applies to abstains, because nothing cleared it. S4.1 already fixed the principle: an empty finding list means "no rule
|
|
20
|
+
* fired", which is weaker than "valid". An item that leaves a check unrun has
|
|
21
|
+
* not been cleared by it.
|
|
22
|
+
* - **abstain** otherwise. Abstention is a first-class outcome and is preferred
|
|
23
|
+
* to a wrong accept (ROADMAP Phase 5, pre-stated criteria).
|
|
24
|
+
*
|
|
25
|
+
* The failure kind a rejection names is a MAPPING from the rule that fired, and
|
|
26
|
+
* it is only as good as that mapping: a dimensional inconsistency is reported as
|
|
27
|
+
* `notation-collision` because that is its commonest cause, not because the rule
|
|
28
|
+
* can see notation. The scorer grades "rejected" and "named the right kind"
|
|
29
|
+
* separately, so an imperfect mapping costs the second score only.
|
|
30
|
+
*
|
|
31
|
+
* @module atlas/benchmark/run-atlas
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
import type { BenchmarkItem, FailureKind } from './types.js';
|
|
35
|
+
/** What the atlas condition concluded about one item. @internal */
|
|
36
|
+
export interface AtlasVerdict {
|
|
37
|
+
readonly itemId: string;
|
|
38
|
+
readonly outcome: 'accept' | 'reject' | 'abstain';
|
|
39
|
+
/** Present on a reject when the rule that fired maps to a failure kind. */
|
|
40
|
+
readonly detectedFailure?: FailureKind;
|
|
41
|
+
/** Every reason, in rule order — including the unrun checks behind an abstention. */
|
|
42
|
+
readonly reasons: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Which instruments a run uses — the S6.2 ablation. The four named
|
|
46
|
+
* configurations in {@link ABLATION_CONFIGS} are CUMULATIVE.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export interface AtlasRunConfig {
|
|
51
|
+
/** The composition table over relation types. */
|
|
52
|
+
readonly types: boolean;
|
|
53
|
+
/** Side-condition rules: unguarded / zero divisors, squaring. */
|
|
54
|
+
readonly assumptions: boolean;
|
|
55
|
+
/** Dimensional consistency and convention agreement. */
|
|
56
|
+
readonly dimensionsAndConventions: boolean;
|
|
57
|
+
/** The regime check at the use site. */
|
|
58
|
+
readonly regimes: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Every instrument on: the atlas condition as scored. @internal */
|
|
61
|
+
export declare const FULL_CONFIG: AtlasRunConfig;
|
|
62
|
+
/** The four cumulative ablation configurations, in the plan's order. @internal */
|
|
63
|
+
export declare const ABLATION_CONFIGS: ReadonlyArray<readonly [string, AtlasRunConfig]>;
|
|
64
|
+
/**
|
|
65
|
+
* Run the atlas condition on one item. Pure and deterministic; never throws.
|
|
66
|
+
*
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
export declare function runAtlasOnItem(item: BenchmarkItem, config?: AtlasRunConfig): AtlasVerdict;
|
|
70
|
+
/** Run the atlas condition over a set of items, in order. @internal */
|
|
71
|
+
export declare function runAtlasCondition(items: readonly BenchmarkItem[], config?: AtlasRunConfig): AtlasVerdict[];
|
|
72
|
+
//# sourceMappingURL=run-atlas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-atlas.d.ts","sourceRoot":"","sources":["../../../src/atlas/benchmark/run-atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAClD,2EAA2E;IAC3E,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC;IACvC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;IAC3C,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,oEAAoE;AACpE,eAAO,MAAM,WAAW,EAAE,cAKzB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,CAK7E,CAAC;AA6CF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,GAAE,cAA4B,GAAG,YAAY,CAoHtG;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,MAAM,GAAE,cAA4B,GACnC,YAAY,EAAE,CAEhB"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas Phase 5, S5.2 — the ATLAS condition of the invalid-bridge benchmark.
|
|
3
|
+
*
|
|
4
|
+
* Design note: `docs/planning/Atlas-Phase-5-Design.md` §6.
|
|
5
|
+
*
|
|
6
|
+
* For each item the runner applies three atlas instruments — the applicability
|
|
7
|
+
* checker (S4.1), the composition table (S3) and the regime check (S2) — and
|
|
8
|
+
* emits `accept`, `reject` or `abstain`.
|
|
9
|
+
*
|
|
10
|
+
* ## The decision rule, and why accept is the HARDEST outcome to reach
|
|
11
|
+
*
|
|
12
|
+
* - **reject** when an instrument DEMONSTRABLY fires: a blocking applicability
|
|
13
|
+
* finding, a chain OVERCLAIMED as an exact equivalence, a structural analogy
|
|
14
|
+
* promoted to an equivalence, or a regime inequality checked and violated.
|
|
15
|
+
* - **accept** only when EVERY ENABLED instrument RAN and CLEARED: side conditions were
|
|
16
|
+
* stated, the applicability checker found nothing, the regime was supplied and
|
|
17
|
+
* every inequality was checked and held, and any claimed chain agrees with the
|
|
18
|
+
* table. At least one instrument must have RUN: an item that no enabled
|
|
19
|
+
* instrument applies to abstains, because nothing cleared it. S4.1 already fixed the principle: an empty finding list means "no rule
|
|
20
|
+
* fired", which is weaker than "valid". An item that leaves a check unrun has
|
|
21
|
+
* not been cleared by it.
|
|
22
|
+
* - **abstain** otherwise. Abstention is a first-class outcome and is preferred
|
|
23
|
+
* to a wrong accept (ROADMAP Phase 5, pre-stated criteria).
|
|
24
|
+
*
|
|
25
|
+
* The failure kind a rejection names is a MAPPING from the rule that fired, and
|
|
26
|
+
* it is only as good as that mapping: a dimensional inconsistency is reported as
|
|
27
|
+
* `notation-collision` because that is its commonest cause, not because the rule
|
|
28
|
+
* can see notation. The scorer grades "rejected" and "named the right kind"
|
|
29
|
+
* separately, so an imperfect mapping costs the second score only.
|
|
30
|
+
*
|
|
31
|
+
* @module atlas/benchmark/run-atlas
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
import { checkApplicability } from '../applicability.js';
|
|
35
|
+
import { composeRelation, NO_COMPOSITE_CLAIM } from '../composition-table.js';
|
|
36
|
+
import { regimeHolds } from '../regime.js';
|
|
37
|
+
/** Every instrument on: the atlas condition as scored. @internal */
|
|
38
|
+
export const FULL_CONFIG = {
|
|
39
|
+
types: true,
|
|
40
|
+
assumptions: true,
|
|
41
|
+
dimensionsAndConventions: true,
|
|
42
|
+
regimes: true,
|
|
43
|
+
};
|
|
44
|
+
/** The four cumulative ablation configurations, in the plan's order. @internal */
|
|
45
|
+
export const ABLATION_CONFIGS = [
|
|
46
|
+
['types only', { types: true, assumptions: false, dimensionsAndConventions: false, regimes: false }],
|
|
47
|
+
['+ assumptions', { types: true, assumptions: true, dimensionsAndConventions: false, regimes: false }],
|
|
48
|
+
['+ dimensions & conventions', { types: true, assumptions: true, dimensionsAndConventions: true, regimes: false }],
|
|
49
|
+
['+ regimes', FULL_CONFIG],
|
|
50
|
+
];
|
|
51
|
+
/** The instrument each applicability finding belongs to. */
|
|
52
|
+
const FINDING_INSTRUMENT = {
|
|
53
|
+
'dimensional-inconsistency': 'dimensionsAndConventions',
|
|
54
|
+
'convention-mismatch': 'dimensionsAndConventions',
|
|
55
|
+
'convention-undeclared': 'dimensionsAndConventions',
|
|
56
|
+
'division-unguarded': 'assumptions',
|
|
57
|
+
'division-by-zero': 'assumptions',
|
|
58
|
+
'squaring-adds-solutions': 'assumptions',
|
|
59
|
+
'model-incompatibility': 'models',
|
|
60
|
+
};
|
|
61
|
+
/** Which failure kind a BLOCKING applicability finding points to. */
|
|
62
|
+
const FINDING_TO_FAILURE = {
|
|
63
|
+
'dimensional-inconsistency': 'notation-collision',
|
|
64
|
+
'convention-mismatch': 'convention-mismatch',
|
|
65
|
+
'division-by-zero': 'domain-violation',
|
|
66
|
+
};
|
|
67
|
+
/** Relations that assert more than an analogy can carry. */
|
|
68
|
+
const STRONG = new Set(['exact-equivalence', 'derivation']);
|
|
69
|
+
/**
|
|
70
|
+
* The failure kind an OVERCLAIMED chain points to: a chain claimed as an exact
|
|
71
|
+
* equivalence that the table composes to something weaker.
|
|
72
|
+
*
|
|
73
|
+
* - through a restriction ⇒ the restriction's condition was dropped:
|
|
74
|
+
* `omitted-premise`;
|
|
75
|
+
* - to a derivation or a coarse-graining ⇒ the claim asserts an inverse the
|
|
76
|
+
* one-way step does not have: `false-inverse`.
|
|
77
|
+
*/
|
|
78
|
+
function overclaimFailure(chain) {
|
|
79
|
+
return chain.includes('restriction') ? 'omitted-premise' : 'false-inverse';
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Whether `claimed` follows from `composed`. The table's own non-declined
|
|
83
|
+
* results are exact-equivalence, derivation, restriction and coarse-graining;
|
|
84
|
+
* of these only exact-equivalence ⇒ derivation is an implication this module
|
|
85
|
+
* asserts. Anything else unequal is "not shown", never "shown".
|
|
86
|
+
*/
|
|
87
|
+
const implies = (composed, claimed) => composed === claimed || (composed === 'exact-equivalence' && claimed === 'derivation');
|
|
88
|
+
/**
|
|
89
|
+
* Run the atlas condition on one item. Pure and deterministic; never throws.
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
export function runAtlasOnItem(item, config = FULL_CONFIG) {
|
|
94
|
+
const reasons = [];
|
|
95
|
+
let rejectKind;
|
|
96
|
+
let rejected = false;
|
|
97
|
+
const reject = (reason, kind) => {
|
|
98
|
+
reasons.push(`REJECT: ${reason}`);
|
|
99
|
+
if (!rejected)
|
|
100
|
+
rejectKind = kind;
|
|
101
|
+
rejected = true;
|
|
102
|
+
};
|
|
103
|
+
let allRanAndCleared = true;
|
|
104
|
+
// An accept needs at least one instrument that actually RAN. Without this,
|
|
105
|
+
// an item no enabled instrument applies to is accepted with nothing checked.
|
|
106
|
+
let ranAny = false;
|
|
107
|
+
const unrun = (reason) => {
|
|
108
|
+
reasons.push(`UNRUN: ${reason}`);
|
|
109
|
+
allRanAndCleared = false;
|
|
110
|
+
};
|
|
111
|
+
// 1. Applicability — split by instrument so the ablation can switch each off.
|
|
112
|
+
const applicabilityOn = config.assumptions || config.dimensionsAndConventions;
|
|
113
|
+
if (!applicabilityOn) {
|
|
114
|
+
// Instrument disabled: neither run nor required.
|
|
115
|
+
}
|
|
116
|
+
else if (item.sideConditions === undefined) {
|
|
117
|
+
unrun('no side conditions stated, so the applicability checker has nothing to check against');
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
ranAny = true;
|
|
121
|
+
const findings = checkApplicability({
|
|
122
|
+
ast: item.expr,
|
|
123
|
+
sideConditions: item.sideConditions,
|
|
124
|
+
...(item.conventions?.premise === undefined ? {} : { premiseConventions: item.conventions.premise }),
|
|
125
|
+
...(item.conventions?.conclusion === undefined
|
|
126
|
+
? {}
|
|
127
|
+
: { conclusionConventions: item.conventions.conclusion }),
|
|
128
|
+
});
|
|
129
|
+
for (const f of findings) {
|
|
130
|
+
const instrument = FINDING_INSTRUMENT[f.kind];
|
|
131
|
+
if (instrument === 'assumptions' && !config.assumptions)
|
|
132
|
+
continue;
|
|
133
|
+
if (instrument === 'dimensionsAndConventions' && !config.dimensionsAndConventions)
|
|
134
|
+
continue;
|
|
135
|
+
if (f.severity === 'blocking')
|
|
136
|
+
reject(`${f.kind}: ${f.detail}`, FINDING_TO_FAILURE[f.kind]);
|
|
137
|
+
else {
|
|
138
|
+
reasons.push(`QUESTION: ${f.kind}: ${f.detail}`);
|
|
139
|
+
allRanAndCleared = false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// 2. Composition. Only for items that claim a chain.
|
|
144
|
+
if (config.types && item.composedFrom !== undefined) {
|
|
145
|
+
ranAny = true;
|
|
146
|
+
const [first, second] = item.composedFrom;
|
|
147
|
+
const composed = composeRelation(first, second);
|
|
148
|
+
if (item.composedFrom.includes('structural-analogy') && STRONG.has(item.claimedRelation)) {
|
|
149
|
+
reject(`a chain through structural-analogy is claimed as ${item.claimedRelation}`, 'analogy-promoted');
|
|
150
|
+
}
|
|
151
|
+
else if (composed === NO_COMPOSITE_CLAIM) {
|
|
152
|
+
reasons.push(`QUESTION: the table declines to compose ${first} ∘ ${second}`);
|
|
153
|
+
allRanAndCleared = false;
|
|
154
|
+
}
|
|
155
|
+
else if (implies(composed, item.claimedRelation)) {
|
|
156
|
+
reasons.push(`CLEARED: ${first} ∘ ${second} composes to ${composed}, which gives ${item.claimedRelation}`);
|
|
157
|
+
}
|
|
158
|
+
else if (item.claimedRelation === 'exact-equivalence') {
|
|
159
|
+
reject(`${first} ∘ ${second} composes only to ${composed}; the exact equivalence is overclaimed`, overclaimFailure(item.composedFrom));
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
reasons.push(`QUESTION: ${first} ∘ ${second} composes to ${composed}; the table does not show ${item.claimedRelation}`);
|
|
163
|
+
allRanAndCleared = false;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// 3. Regime.
|
|
167
|
+
if (!config.regimes) {
|
|
168
|
+
// Instrument disabled: neither run nor required.
|
|
169
|
+
}
|
|
170
|
+
else if (item.regime === undefined) {
|
|
171
|
+
unrun('no regime supplied, so the use site was never checked against a domain');
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
ranAny = true;
|
|
175
|
+
const check = regimeHolds({ family: item.family, inequalities: item.regime.inequalities, groupDefinitions: {} }, item.regime.values);
|
|
176
|
+
if (check.ok === false) {
|
|
177
|
+
reject(`regime violated: ${check.violated.map((i) => `${i.group} ${i.op} ${i.bound}`).join(', ')}`, 'domain-violation');
|
|
178
|
+
}
|
|
179
|
+
else if (check.ok === 'unknown') {
|
|
180
|
+
unrun(`regime unchecked for ${check.unchecked.map((i) => i.group).join(', ')}`);
|
|
181
|
+
}
|
|
182
|
+
else if (item.regime.inequalities.length === 0) {
|
|
183
|
+
// regimeHolds returns true for an empty list; that is "nothing to check",
|
|
184
|
+
// not "checked and held" — the silent pass RegimeCheck warns about.
|
|
185
|
+
unrun('the regime states no inequality, so nothing was checked');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (rejected) {
|
|
189
|
+
return {
|
|
190
|
+
itemId: item.id,
|
|
191
|
+
outcome: 'reject',
|
|
192
|
+
...(rejectKind === undefined ? {} : { detectedFailure: rejectKind }),
|
|
193
|
+
reasons,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
if (allRanAndCleared && !ranAny) {
|
|
197
|
+
reasons.push('UNRUN: no enabled instrument applies to this item, so nothing was checked');
|
|
198
|
+
return { itemId: item.id, outcome: 'abstain', reasons };
|
|
199
|
+
}
|
|
200
|
+
if (allRanAndCleared) {
|
|
201
|
+
reasons.push('ACCEPT: every instrument ran and cleared');
|
|
202
|
+
return { itemId: item.id, outcome: 'accept', reasons };
|
|
203
|
+
}
|
|
204
|
+
return { itemId: item.id, outcome: 'abstain', reasons };
|
|
205
|
+
}
|
|
206
|
+
/** Run the atlas condition over a set of items, in order. @internal */
|
|
207
|
+
export function runAtlasCondition(items, config = FULL_CONFIG) {
|
|
208
|
+
return items.map((item) => runAtlasOnItem(item, config));
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=run-atlas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-atlas.js","sourceRoot":"","sources":["../../../src/atlas/benchmark/run-atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA+B3C,oEAAoE;AACpE,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,KAAK,EAAE,IAAI;IACX,WAAW,EAAE,IAAI;IACjB,wBAAwB,EAAE,IAAI;IAC9B,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,gBAAgB,GAAqD;IAChF,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACpG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACtG,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AS,EAAE,OAAO,EAAE,CAAC;AAC1D,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAC/B,KAA+B,EAC/B,MAAM,GAAmB,WAAW;IAEpC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas Phase 5, S5.4 — the benchmark's statistics and power report.
|
|
3
|
+
*
|
|
4
|
+
* Design note: `docs/planning/Atlas-Phase-5-Design.md` §8.
|
|
5
|
+
*
|
|
6
|
+
* Every function here is tested against a value computed independently, not
|
|
7
|
+
* against its own output: the Wilson intervals against the plan's textbook
|
|
8
|
+
* values, McNemar against a hand-computed 2×2 table, and κ against a hand-computed
|
|
9
|
+
* confusion matrix. The paired-difference interval (Newcombe's method 10) has no
|
|
10
|
+
* textbook value in the repository; it is tested by properties that pin it to
|
|
11
|
+
* Wilson and to the unpaired square-and-add interval where those must agree.
|
|
12
|
+
*
|
|
13
|
+
* @module atlas/benchmark/stats
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
/** The two-sided 95% normal quantile. @internal */
|
|
17
|
+
export declare const Z95 = 1.959963984540054;
|
|
18
|
+
/** A closed interval. @internal */
|
|
19
|
+
export interface Interval {
|
|
20
|
+
readonly lower: number;
|
|
21
|
+
readonly upper: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Wilson score interval for a binomial proportion.
|
|
25
|
+
*
|
|
26
|
+
* @throws Error when `n` is not a positive integer or `successes` is outside `[0, n]`.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function wilsonInterval(successes: number, n: number, z?: number): Interval;
|
|
30
|
+
/** A paired 2×2 table: a = both right, b = only A right, c = only B right, d = both wrong. @internal */
|
|
31
|
+
export interface PairedTable {
|
|
32
|
+
readonly a: number;
|
|
33
|
+
readonly b: number;
|
|
34
|
+
readonly c: number;
|
|
35
|
+
readonly d: number;
|
|
36
|
+
}
|
|
37
|
+
/** McNemar's test on the discordant cells. @internal */
|
|
38
|
+
export interface McNemarResult {
|
|
39
|
+
/** Continuity-corrected χ² = (|b − c| − 1)² / (b + c); 0 when b + c = 0. */
|
|
40
|
+
readonly chiSquared: number;
|
|
41
|
+
/** Exact two-sided p-value from Binomial(b + c, ½); 1 when b + c = 0. */
|
|
42
|
+
readonly exactP: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* McNemar's paired test. The EXACT binomial p-value is the one to report at
|
|
46
|
+
* these sample sizes; the χ² is given because readers expect it.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export declare function mcnemar(table: PairedTable): McNemarResult;
|
|
51
|
+
/**
|
|
52
|
+
* Newcombe's method 10: a 95% interval for the PAIRED difference in proportions
|
|
53
|
+
* p_A − p_B = (b − c)/n, built from the two marginal Wilson intervals and a
|
|
54
|
+
* correlation correction φ. Pre-registered criterion: the interval for the
|
|
55
|
+
* atlas-minus-baseline difference must exclude zero.
|
|
56
|
+
*
|
|
57
|
+
* Newcombe, Statistics in Medicine 17 (1998) 2635.
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export declare function pairedDifferenceInterval(table: PairedTable, z?: number): Interval & {
|
|
62
|
+
readonly diff: number;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Cohen's κ for two raters over the same items, from a square confusion matrix
|
|
66
|
+
* (`matrix[i][j]` = items rater 1 put in category i and rater 2 in category j).
|
|
67
|
+
*
|
|
68
|
+
* @returns NaN when chance agreement is 1 (κ is undefined there), never 1.
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export declare function cohensKappa(matrix: readonly (readonly number[])[]): number;
|
|
72
|
+
/** What a frozen set of a given size can and cannot resolve. @internal */
|
|
73
|
+
export interface PowerReport {
|
|
74
|
+
readonly nPerClass: number;
|
|
75
|
+
/** The assumed per-class accuracy the interval is computed at. */
|
|
76
|
+
readonly assumedAccuracy: number;
|
|
77
|
+
readonly interval: Interval;
|
|
78
|
+
/** Half the interval width: differences smaller than about twice this are not resolvable. */
|
|
79
|
+
readonly halfWidth: number;
|
|
80
|
+
readonly statement: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The interval a frozen set of `nPerClass` items per class can afford at an
|
|
84
|
+
* assumed accuracy. This is the "report the interval it can afford rather than
|
|
85
|
+
* the claim it cannot" line of ROADMAP Phase 5.
|
|
86
|
+
*
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
export declare function powerReport(nPerClass: number, assumedAccuracy?: number): PowerReport;
|
|
90
|
+
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/atlas/benchmark/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,mDAAmD;AACnD,eAAO,MAAM,GAAG,oBAAoB,CAAC;AAErC,mCAAmC;AACnC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,SAAM,GAAG,QAAQ,CAgB9E;AAED,wGAAwG;AACxG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wDAAwD;AACxD,MAAM,W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