Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .github/bdd-parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@
],
"bootstrap-manifest-text": [
"BS-34"
],
"bootstrap-lexicon-schema": [
"BS-50"
],
"bootstrap-lse-scopes": [
"BS-51"
],
"bootstrap-lse-types": [
"BS-52"
]
},
"targets": {
Expand Down
2 changes: 1 addition & 1 deletion .github/intel-host-lanes.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"producer": ["honesty"],
"lanes": {
"lower": ["bootstrap-lower", "bootstrap-lexicon-lse", "bootstrap-lexicon-lre", "bootstrap-surface-module", "bootstrap-diagnostics", "bootstrap-cli-output"],
"lower": ["bootstrap-lower", "bootstrap-lexicon-lse", "bootstrap-lexicon-lre", "bootstrap-surface-module", "bootstrap-diagnostics", "bootstrap-cli-output", "bootstrap-lexicon-schema", "bootstrap-lse-scopes", "bootstrap-lse-types"],
"print": ["bootstrap-print", "bootstrap-bodies", "bootstrap-succeed", "bootstrap-loops", "bootstrap-assemble", "bootstrap-package", "bootstrap-check", "bootstrap-gnaf", "bootstrap-runtime", "bootstrap-terms", "bootstrap-tooling-latex", "bootstrap-structural-grammar", "bootstrap-surface-lex", "bootstrap-surface-doc", "bootstrap-surface-generic", "bootstrap-surface-tooling", "bootstrap-lock-text", "bootstrap-content-id", "bootstrap-project-text", "bootstrap-manifest-text"],
"validate": ["bootstrap-validate", "compiler", "preservation", "preservation-lists", "preservation-runtime", "preservation-support", "preservation-prims", "preservation-std", "production"],
"moves": ["bootstrap-moves", "verification", "rest"]
Expand Down
27 changes: 27 additions & 0 deletions .github/vv-rows.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,5 +358,32 @@
"width": "",
"memory_kib": "",
"hints": ""
},
{
"part": "bdd-bootstrap-lexicon-schema",
"recipes": "bdd",
"examples_part": "",
"bdd_part": "bootstrap-lexicon-schema",
"width": "",
"memory_kib": "",
"hints": ""
},
{
"part": "bdd-bootstrap-lse-scopes",
"recipes": "bdd",
"examples_part": "",
"bdd_part": "bootstrap-lse-scopes",
"width": "",
"memory_kib": "",
"hints": ""
},
{
"part": "bdd-bootstrap-lse-types",
"recipes": "bdd",
"examples_part": "",
"bdd_part": "bootstrap-lse-types",
"width": "",
"memory_kib": "",
"hints": ""
}
]
12 changes: 12 additions & 0 deletions .github/workflows/regenerate.yml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ jobs:
sudo mkswap "$RUNNER_TEMP/lexlean-regenerate.swap"
sudo swapon "$RUNNER_TEMP/lexlean-regenerate.swap"
sudo sysctl vm.swappiness=10
- name: Refresh the project locks
shell: bash
run: |
set -euo pipefail
cargo build -q -p lexlean
L="$PWD/target/debug/lexlean"
for p in bootstrap stdlib compiler; do (cd "$p" && "$L" lock); done
- name: Run the write recipes
shell: bash
env:
Expand All @@ -114,6 +121,11 @@ jobs:
set -euo pipefail
mkdir -p "$RUNNER_TEMP/part"
git add --all
# Every writer refreshes the locks, because its recipes read them; one
# writer reports them, or `combine` sees three parts write one path.
if [ "${{ matrix.writer }}" != production-export ]; then
git reset -q -- bootstrap/lexlean.lock stdlib/lexlean.lock compiler/lexlean.lock
fi
git diff --cached --binary > "$RUNNER_TEMP/part/${{ matrix.writer }}.patch"
git diff --cached --name-only | tee "$RUNNER_TEMP/part/${{ matrix.writer }}.files"
echo "${{ matrix.writer }}: $(wc -l < "$RUNNER_TEMP/part/${{ matrix.writer }}.files") paths" >> "$GITHUB_STEP_SUMMARY"
Expand Down
21 changes: 12 additions & 9 deletions CONFORMANCE.md

Large diffs are not rendered by default.

118 changes: 86 additions & 32 deletions SPEC.md

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions VERIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11552,6 +11552,128 @@ axioms the module now declares. The case then stops at the stack-bound step,
bootstrap member did before its regeneration, which produces the package and
measures the root's stack bound.

### the tables of the lexicon entry schema are source (BS-50)

`BS-50` holds the six production roots of `LexLeanBoot.LexiconSchema`
(`bootstrap/src/LexiconSchema.lex.tex`) to `lexicon::entry` and
`lexicon::package`: `tokenIndex` to the category, frame, channel, and
associativity parsers and the feature list, as a position in the schema's
order; `shapeFacts` to `frame_permitted`, `Frame::fixed_arity`, and the
category's `core_only`, `has_signature`, `required_channels`, and
`needs_some_canonical`; `surfaceSafety` to `surface_safety` over the atoms the
primitive scanner returns, which reads each scalar of a Unicode atom from its
UTF-8 bytes against the allow-list of `is_math_safe_scalar`; `isLeanName` to
`is_lean_name`; `tomlCommentAt` to `toml_comment_at`; and `entryPath` to
`entry_path`. No root admits `recursion`: each scan is a loop under
`iterate_until` or a fold. The oracle is the existing public code of
`entry.rs` and `package.rs`; no Rust outside the case changes.

The case holds the roots to the oracle on hand-built vectors that reach every
token of every table and near misses, every category with every frame at
arities 0 to 3 and at the largest, every class of atom in every channel and
the edges of every range of the allow-list, Lean names with empty, leading,
and trailing segments, comments inside and after every TOML string form with
escapes, and entry IDs of empty segments; on every form surface in its own
channel and the two others, every Lean name of a denotation or an eliminator,
and every entry ID of the committed lexicon entries, and on every committed
TOML file; and on seeded inputs. Each of the 24 planted defects names the one
vector that catches it, and the case asserts that the site of each plant
occurs once. The row's statement carries no counts.

The case was first compiled and run on the normative host over `release/v0.4`
at `26e5e0ace` (`cargo test -p repo-conformance --test conformance --
conformance_bs_50`). Its corpus is 838 named vectors, 1,064 committed forms,
725 Lean names, 1,007 entry IDs, 1,055 lexicon files, and 1,683 other TOML
files, and 300 and 2,000 seeded runs per root. The evaluator agrees with the
oracle on 8,317 runs, the rendered packages under the pinned rustc on 18,500
runs, and each of the 24 planted defects is detected by its own vector. The
case then stops at the stack-bound step, `bootstrap/token_index is no package
of the committed exports`, as each bootstrap member does before its
regeneration, which produces the six packages.

### the scopes and references of a semantic expression are source (BS-51)

`BS-51` holds the three production roots of `LexLeanBoot.LseScopes`
(`bootstrap/src/LseScopes.lex.tex`) to `lexicon::lse`: `checkScopes` to
`Lse::check_scopes`, `referencedConsts` to `Lse::referenced_consts`, and
`outerShape` to `outer_explicit_binders` with whether `result` is a sort. Each
walks an expression of `BS-25` with an explicit work stack in the oracle's
order of visit, so that the first error is the oracle's first; a universe is
walked on the same stack, and a scope is a list truncated when its binder
ends. The host passes the length of the expression's text, which bounds the
walk. No root admits `recursion`. The oracle is the existing public code of
`lse.rs`; the case reads the encoder and the seeded expressions of `BS-25`'s
case, made visible to its sibling, and no other Rust changes.

The case holds the roots to the oracle on hand-built expressions that reach
both errors, a binder's type before its name, a `let`'s value before its name,
shadowing, the end of the scope of every binder form, and every universe form;
on every signature and defined value of the committed lexicon entries under
the universes its entry declares, each of which the case asserts is in scope;
and on seeded expressions under seeded declarations. Each of the 14 planted
defects names the one vector that catches it, and the case asserts that the
site of each plant occurs once. The row's statement carries no counts.

The case was first compiled and run on the normative host over `release/v0.4`
at `26e5e0ace` (`cargo test -p repo-conformance --test conformance --
conformance_bs_51`). Its corpus is 43 named vectors, the 417 committed
signatures and defined values, and 300 and 2,000 seeded expressions. The
evaluator agrees with the oracle on 2,194 runs, the rendered packages under
the pinned rustc on 7,294 runs, and each of the 14 planted defects is detected
by its own vector. The case then stops at the stack-bound step, as each
bootstrap member does before its regeneration, which produces the three
packages.

### the checker of semantic expressions is source (BS-52)

`BS-52` holds the two production roots of `LexLeanBoot.LseTypes`
(`bootstrap/src/LseTypes.lex.tex`) to `lexicon::lse::check_signature` and
`check_value`: the zonked type and the type of every natural literal in
occurrence order, or the message of the first error. The module threads the
oracle's state through inference, unification, zonking, and capture-avoiding
substitution: solved metavariables are named `?n` in the order the oracle
makes them, a renamed binder is `x#n` with the oracle's counter, and every
message prints its expressions with `printLse` of `BS-25`. Each recursive
definition is structural over a chain the host's bound on nesting builds, so
the roots admit `recursion`; a root whose bound runs out returns an error of
its own, which no run of the case reaches. What the oracle's lookup closure
answers is handed over as rows and a fallback. The oracle is the existing
public code of `lse.rs`; the case reads the encoder and the seeded
expressions of `BS-25`'s case, and no other Rust changes.

The case holds the roots to the oracle on hand-built expressions over a
hand-built glossary that reach every error of the checker, an opaque head, a
defined result type, partial application, literals of an inferred and an
undetermined type, a binder and a `let` renamed to avoid capture, and binders
named apart; on every signature and defined value of the committed lexicon
packages, checked against its own package with every other constant opaque
as a package loads and against the builtin packages with every other
constant missing as a closure does; and on seeded expressions. Each of the 20
planted defects names the one vector that catches it, and the case asserts
that the site of each plant occurs once. The row's statement carries no
counts.

The case passes a bound of 192: the evaluator copies the chain the bound
builds at each call, so a bound of 4,096 made each run cost seconds, and no
committed or seeded expression nests near 192. Two rules of the Rust rendering
shaped the source. A call that can overflow is bound with `let` or is the
value the function returns, never an operand, so each message prints its
expressions into names first. And a definition that calls itself as its last
step is rendered as a loop whose exit does not propagate the overflow of a
call to another definition, so `inferBinding`, `inferRest`, and `unifyPiLoop`
bind their own recursive call and rebuild its record.

The case was first compiled and run on the normative host over `release/v0.4`
at `26e5e0ace` (`cargo test -p repo-conformance --test conformance --
conformance_bs_52`). Its corpus is 39 named vectors, the signatures and
defined values of the 43 committed packages that load (224 signature and 236
value runs), and 200 and 1,500 seeded expressions. The evaluator agrees with
the oracle on 899 runs, the rendered packages under the pinned rustc on 3,499
runs, and each of the 20 planted defects is detected by its own vector. The
case then stops at the stack-bound step, `bootstrap/check_signature is no
package of the committed exports`, as each bootstrap member does before its
regeneration, which produces the two packages and measures their stack bounds.

### the lexer of the authoring notation is source (BS-22)

`BS-22` holds the two production roots of `LexLeanBoot.SurfaceLex`
Expand Down
9 changes: 9 additions & 0 deletions bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ writers it uses, and the standard library's `Numeral`, `Order`, and `Sha256`, an
canonical project manifest of SPEC.md §10.1 and its digest.
`src/ManifestText.lex.tex` (SPEC.md §17.23, `BS-34`) imports the standard library's `Json`,
`Numeral`, `Order`, and `Text`, and writes the build manifest of SPEC.md §21.6.
`src/LexiconSchema.lex.tex` (SPEC.md §17.23, `BS-50`) imports `PrimitiveScan` (`BS-03`), whose
atoms it reads, `LexiconLse` (`BS-25`), whose byte classes it uses, and the standard library's
`Text`: the tables and predicates of the lexicon entry schema of SPEC.md §13.
`src/LseScopes.lex.tex` (SPEC.md §17.23, `BS-51`) imports `LexiconLse` (`BS-25`), whose
expressions it walks, and the standard library's `Order`: the scopes, references, and outer
shape of a semantic expression of SPEC.md §13.8.
`src/LseTypes.lex.tex` (SPEC.md §17.23, `BS-52`) imports `LexiconLse` (`BS-25`), whose
expressions it checks and prints, and the standard library's `Numeral` and `Order`: the
conservative checker of semantic expressions of SPEC.md §13.7.

Large diffs are not rendered by default.

Loading
Loading