Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@ versions. `v0.1.0` is tagged, and `v0.4.0` is tagged at the commit that carries
this changelog; the sections for `0.1.1`, `0.2.0`, and `0.3.0` record what the
workspace carried at those versions without a tag.

## 0.4.1

A patch on `v0.4.0` carrying one fix, also landed on `release/v0.4` as #529;
nothing else of that line is here, and no language identity moves.

- A semantic module nests as deeply as the project's `max_scope_depth` allows
(SPEC.md §17.17, §17.21.3, `SM-12`, #528; no new diagnostic code). The front
end read a module's JSON with a fixed 128-level limit, so a list of more than
about 122 elements was refused, and past about 115 the semantic snapshot
panicked writing its own bytes. Both the JSON and the notation are now read
to the project's bound on the compile thread's stack, and every later
reading of what the linker admitted (rendering, definition digests, the
snapshot and its canonical bytes) reads to the same depth on a stack sized
for it: a list of 1000 elements checks, builds, verifies, and has a
snapshot. Past the bound the notation is `LLP2001` and the data `LLT4001`,
each naming `max_scope_depth`. The readable type and term forms of the
notation gain the depth check the generic form had. The authoring API
(`lexlean::sdk`) reads, converts, and writes a semantic module to 1024
levels, the default `max_scope_depth`, on a stack of its own, where it read
the notation to 256 and the JSON to 128 on its caller's. A module within the old
limits reads, renders, and hashes to the same bytes as in `0.4.0`.

## 0.4.0

Release `0.4.0` is cut at the downstream boundary (#92, 2026-10-25): what the
Expand Down
2 changes: 1 addition & 1 deletion CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ the error registry does not sanction (R5, `ERRORS.md`).
| `SM-09` | `build` | Linked IR has stable schema-tagged canonical JSON with alpha-safe binder serialization. |
| `SM-10` | `build` | Source ID and semantic ID use exactly the specified framed hash inputs. |
| `SM-11` | `build` | Linked project result sets contain every selected module and imported module exactly once in stable order. |
| `SM-12` | `build` | No semantic IR node can contain opaque prose, raw backend text, or an unknown extension. |
| `SM-12` | `build` | No semantic IR node can contain opaque prose, raw backend text, or an unknown extension. A semantic module nests as deeply as the project's max_scope_depth allows, in its notation and in its data: a list of 1000 elements checks and builds, and its snapshot is written, and the authoring API reads and writes it, on a caller's default stack without a panic, while a list nested past the bound is refused, with LLP2001 in the notation and LLT4001 in the data, naming max_scope_depth. |
| `SM-13` | `build` | Inherited section parameters are represented explicitly and emitted only on declarations that use them. |
| `SM-14` | `build` | A numeral without a unique expected type is rejected rather than defaulted. |
| `SM-15` | `build` | A native core module is closed typed DAG data shared by both backends, carries explicit declaration policies, and accepts no backend source text. |
Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/*", "xtask"]

[workspace.package]
version = "0.4.0"
version = "0.4.1"
edition = "2021"
rust-version = "1.97"
license = "MIT OR Apache-2.0"
Expand All @@ -17,9 +17,9 @@ categories = ["compilers", "development-tools"]
# A `path` dependency with no `version` is a wildcard requirement, and
# `cargo deny` refuses those (`wildcards = "deny"`). Every internal dependency
# carries both.
repo-model = { version = "0.4.0", path = "crates/model" }
repo-conformance = { version = "0.4.0", path = "crates/conformance" }
lexlean = { version = "0.4.0", path = "crates/lexlean" }
repo-model = { version = "0.4.1", path = "crates/model" }
repo-conformance = { version = "0.4.1", path = "crates/conformance" }
lexlean = { version = "0.4.1", path = "crates/lexlean" }

camino = "1.2"
clap = { version = "4.5", features = ["derive"] }
Expand Down
30 changes: 22 additions & 8 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The root workspace metadata MUST be:

```toml
[workspace.package]
version = "0.4.0"
version = "0.4.1"
edition = "2021"
rust-version = "1.97"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -5397,10 +5397,19 @@ because they bound what verification can be given. Checking a project holds
memory that grows linearly with the number of its functions when they are
independent (1500, 3000, 7000, and 14000 trivial functions take 56, 101, 223,
and 435 MB), before any limit of this section or of `max_ir_nodes` is reached;
a chain of calls is the case above. And a semantic module is JSON read with the
reader's recursion limit of 128 levels: a term nested deeper than that (a chain
of 130 nested `let`s) is `LLT4001`, `invalid semantic-module JSON: recursion
limit exceeded`, whatever `max_scope_depth` says; a chain of 100 is read.
a chain of calls is the case above. And a semantic module nests as deeply as
the project's `max_scope_depth` allows, as the compile thread's stack hosts it
(§25.5), in its notation and in the JSON the notation reads to; a list of n
elements nests about n levels, and a chain of n nested `let`s about n. Notation
nested deeper is `LLP2001`, and JSON nested deeper is `LLT4001`, each naming
`max_scope_depth`; the JSON diagnostic also recommends splitting long lists
into smaller definitions joined by `prim append`. Both locate the
semantic-module body, not the nested term; neither reports coordinates in
generated JSON as positions in the authored source. Every later reading of
what the linker admitted (the rendering of a build, definition digests, the
semantic snapshot and its canonical bytes) reads it to the same depth, on a
stack sized for it, never on its caller's: a list of 1000 elements checks,
builds, verifies, and has a snapshot (`SM-12`).

**Proof.** The proof follows the source term construct by construct through
the library's compatibility lemmas. A recursive definition's relation is
Expand Down Expand Up @@ -7304,8 +7313,13 @@ with that member left out. Members are written in the order `name`,
`type_parameters`, `parameters`, `type`, `result`, `statement`, `fields`,
`constructors`, `arguments`, `body`, `proof`, `axioms`, then the others in
key order, and are read in any order; a member written twice, an integer
beyond 64 bits, a value nested deeper than 256 levels, and a word that is not
a name where a string is expected are errors. Because the generic notation
beyond 64 bits, a value nested deeper than its reader reads, and a word that
is not a name where a string is expected are errors. A project's semantic
module is read to its `max_scope_depth` (§17.17, the limits of the front end);
the authoring library (§24.8) reads a semantic module to 1024 levels, the
`max_scope_depth` a project is created with, on a stack sized for them; any
other text read with no project, to 256 levels.
Because the generic notation
covers every value, no value of any schema is unspellable, and a variant added
to a schema has a notation the day it is added.

Expand Down Expand Up @@ -10646,7 +10660,7 @@ Every row below is normative, has honesty level `build`, and MUST be copied byte
| `SM-09` | `semantic-ir` | Linked IR has stable schema-tagged canonical JSON with alpha-safe binder serialization. | §17.9 |
| `SM-10` | `semantic-ir` | Source ID and semantic ID use exactly the specified framed hash inputs. | §21.3, §21.4 |
| `SM-11` | `semantic-ir` | Linked project result sets contain every selected module and imported module exactly once in stable order. | §17.5, §23.3 |
| `SM-12` | `semantic-ir` | No semantic IR node can contain opaque prose, raw backend text, or an unknown extension. | §6 I4, §17 |
| `SM-12` | `semantic-ir` | No semantic IR node can contain opaque prose, raw backend text, or an unknown extension. A semantic module nests as deeply as the project's max_scope_depth allows, in its notation and in its data: a list of 1000 elements checks and builds, and its snapshot is written, and the authoring API reads and writes it, on a caller's default stack without a panic, while a list nested past the bound is refused, with LLP2001 in the notation and LLT4001 in the data, naming max_scope_depth. | §6 I4, §17 |
| `SM-13` | `semantic-ir` | Inherited section parameters are represented explicitly and emitted only on declarations that use them. | §17.5, §18.3 |
| `SM-14` | `semantic-ir` | A numeral without a unique expected type is rejected rather than defaulted. | §15.5 |
| `SM-15` | `semantic-ir` | A native core module is closed typed DAG data shared by both backends, carries explicit declaration policies, and accepts no backend source text. | §17.10 |
Expand Down
39 changes: 39 additions & 0 deletions VERIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11385,3 +11385,42 @@ script's output to that function, so the file the gate job writes is the file
| the committed tree | `cargo test -p repo-conformance --test conformance conformance_rp_18 -- --exact` | ok |
| the script no longer writes the gate line | same | `the evidence satisfies the release criterion` failed: `Err(["release/vv-evidence.txt does not record the gate passing"])` |
| the criterion accepts the legs' lines | `cargo test -p repo-model the_ci_evidence_criterion` | `left: Ok(())` against the refusal |

## A semantic module nests to `max_scope_depth`, on `v0.4.0` (`SM-12`, #528)

A patch on tag `v0.4.0` carrying only the fix of #529, for consumers that pin
`v0.4.0` and must keep their artifacts byte-identical. Before it, on a Windows
host with the debug compiler, a language-1.2 project whose one definition is a
list of more than about 122 cells was `LLT4001` from the 128-level JSON reader,
and past about 115 the semantic snapshot panicked writing its own bytes.

The fix is #529's, applied to `v0.4.0`. Two parts of #529 do not apply here:
declaration IDs, which `v0.4.0` does not have, and the #375 diagnostic, which
`v0.4.0` predates. One part of the later line comes with it: the readable type
and term forms of the notation gain the depth check the generic form had, six
lines, which the fix needs to refuse a deep list instead of recursing on it.
It can refuse nothing `v0.4.0` accepted, since anything nested past 128 JSON
levels was already refused and the check fires at `max_scope_depth`.

With the patched compiler: lists of 130, 256, and 1000 cells check and build,
and 1100 is `LLP2001` naming `max_scope_depth` 1024. `lexlean verify` with the
pinned Lean 4.32.1 verified 256 cells (26 s) and 1000 cells (22 s).
`conformance_sm_12` passes (4 s). The planted defects of #529 each fail it: the
linker reading with `parse` (127 levels); `to_json` re-reading with the
bounded `Json::parse` (panic); `canonical_bytes` on its caller's stack
(`STATUS_STACK_OVERFLOW`). `SP-02`'s 130-level let-chain refusal becomes the
assertion that the chain checks.

The authoring API had the same limits on its caller's stack (notation 256,
JSON 128). It now reads a semantic module to 1024 levels on a stack of its
own; `conformance_sm_12` reads, converts both ways, and writes the 1000-cell
fixture through it on a 2 MiB thread and refuses the 1100-cell one, and fails
when the API reads the notation to 256 levels or runs on its caller's stack.
`conformance_au_08`, which reads every committed module through the API, passes
(862 s).

Against `v0.4.0` itself: the diff touches no identity input (`language/`,
`schemas/`, the embedded goldens); every one of the 17 examples' committed
locks (languages 1.0, 1.1, and 1.2) passes `lexlean lock --check` under the
patched compiler, so no compiler-semantics ID moves; and `cargo xtask
check-golden` passes for every project, so no published artifact moves.
Loading
Loading