Skip to content
Merged
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ workspace carried at those versions without a tag.
dispatch or `release-gate.sh`, so a tag's evidence is still one run with
every host. `RP-14` and `RP-18` pin the new cases.

- `AU-01` reads the committed corpus one module at a time (SPEC.md §9.4). It
collected every semantic module of the repository as a value before checking
any, and the corpus holds modules of tens of megabytes, so the case alone
peaked at 11.2 GiB of resident memory in a debug test process. The
`bdd-verification` leg runs it on four test threads beside `AU-08`, `AU-09`
and the Lean processes of `NE-01` and the `VR` cases on a 16 GB runner, and
the leg intermittently exhausted memory and swap and lost the runner, failing
whichever case was running then. The case checks the same modules with the
same assertions; each is dropped once checked.

- Canonical JSON refuses duplicate keys that differ only in their escapes (SPEC.md §21.7,
`AR-11`, #475). The duplicate check compared each key as written, so `{"a":1,"\u0061":2}`
passed it and `Json::parse` returned `{"a":2}`, dropping the first member; keys are now
Expand Down
34 changes: 17 additions & 17 deletions crates/conformance/src/cases/authoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ const CORE_SPEC: &str = "lexlean/core-module/2";
/// Every semantic module of a committed source, as canonical JSON, with the
/// file it is in. A module that is not well formed is a negative fixture's
/// business and is left out.
fn corpus() -> Vec<(String, Json)> {
///
/// The modules are read one at a time, as the walk reaches them, and each is
/// dropped when the caller is done with it: the corpus includes modules of
/// tens of megabytes, and held whole as values it peaked at over 11 GiB of a
/// debug test process, most of the 16 GB runner its CI leg shares with the
/// part's other cases (§9.4).
fn corpus() -> impl Iterator<Item = (String, Json)> {
let root = repo_root();
let mut modules = Vec::new();
for entry in walkdir::WalkDir::new(root.as_std_path())
walkdir::WalkDir::new(root.as_std_path())
.into_iter()
.filter_entry(|entry| {
let name = entry.file_name().to_string_lossy();
Expand All @@ -88,21 +93,16 @@ fn corpus() -> Vec<(String, Json)> {
&& !support::holds_cache_tag(entry)
})
.flatten()
{
let path = entry.path();
if !path.to_string_lossy().ends_with(".lex.tex") {
continue;
}
let Ok(text) = std::fs::read_to_string(path) else {
continue;
};
if let Ok(value) = support::try_module_json(&text) {
if let Ok(json) = Json::parse(value.to_string().as_bytes()) {
modules.push((path.display().to_string(), json));
.filter_map(|entry| {
let path = entry.path();
if !path.to_string_lossy().ends_with(".lex.tex") {
return None;
}
}
}
modules
let text = std::fs::read_to_string(path).ok()?;
let value = support::try_module_json(&text).ok()?;
let json = Json::parse(value.to_string().as_bytes()).ok()?;
Some((path.display().to_string(), json))
})
}

// ---------------------------------------------------------------------------
Expand Down
Loading