Release 0.66.0: the overnight queue, complete
Closes TODO §71: eight owner-ordered features shipped as 0.65.2–0.65.11. No engine change since 0.65.11. - docs/topo.md refreshed through 0.65.11: contracts, server-lane edges, packaging rows, open handshakes 44–66, new modules, choke points; stale FACTS_FORMAT and state.rs references corrected. - CLAUDE.md: file sizes re-measured. - Feature READMEs: five stale facts corrected. - large.rs: the two linear-time tests re-measure up to three times before failing (0.65.11's Linux CI run read 24.9x against a 24x limit under load). Co-Authored-By: Claude Mythos 5.2 <[email protected]>
This commit is contained in:
1 parent
cc1e2c8b72
commit
10cb6e020f
16 files changed
+265
-74
No files matched your search
@@ -832,14 +832,15 @@ mod tests {
|
||||
for doc in &docs {
|
||||
assert!(!window(doc, range(0, 1)).tokens.is_empty());
|
||||
}
|
||||
let costs = fastest_of_five(&docs, |doc| {
|
||||
let clock = Instant::now();
|
||||
let data = crate::tokens::semantic_tokens_in_window(doc, range(0, 1));
|
||||
let elapsed = clock.elapsed();
|
||||
assert!(!data.is_empty(), "the window really did colour something");
|
||||
elapsed
|
||||
assert_grows_linearly(&sizes, "colouring tokens on one line", || {
|
||||
fastest_of_five(&docs, |doc| {
|
||||
let clock = Instant::now();
|
||||
let data = crate::tokens::semantic_tokens_in_window(doc, range(0, 1));
|
||||
let elapsed = clock.elapsed();
|
||||
assert!(!data.is_empty(), "the window really did colour something");
|
||||
elapsed
|
||||
})
|
||||
});
|
||||
assert_grows_linearly(&sizes, &costs, "colouring tokens on one line");
|
||||
}
|
||||
|
||||
/// **QA finding 1 (2026-08-27), fixed and now a gate**, on the *other*
|
||||
@@ -879,17 +880,18 @@ mod tests {
|
||||
(doc, hits)
|
||||
})
|
||||
.collect();
|
||||
let costs = fastest_of_five(&docs, |(doc, hits)| {
|
||||
let positions = doc.positions();
|
||||
let clock = Instant::now();
|
||||
// Exactly what `Server::large_scan` does with them.
|
||||
let mut walker = positions.walker();
|
||||
for hit in hits {
|
||||
std::hint::black_box(walker.range(*hit));
|
||||
}
|
||||
clock.elapsed()
|
||||
assert_grows_linearly(&sizes, "locating hits on one line", || {
|
||||
fastest_of_five(&docs, |(doc, hits)| {
|
||||
let positions = doc.positions();
|
||||
let clock = Instant::now();
|
||||
// Exactly what `Server::large_scan` does with them.
|
||||
let mut walker = positions.walker();
|
||||
for hit in hits {
|
||||
std::hint::black_box(walker.range(*hit));
|
||||
}
|
||||
clock.elapsed()
|
||||
})
|
||||
});
|
||||
assert_grows_linearly(&sizes, &costs, "locating hits on one line");
|
||||
}
|
||||
|
||||
/// How much faster than its input a linear-time test's cost may grow
|
||||
@@ -913,21 +915,40 @@ mod tests {
|
||||
fastest
|
||||
}
|
||||
|
||||
/// How many times a measurement over [`GROWTH_SLACK`] is taken again
|
||||
/// before the test fails. Load from the tests running beside this one
|
||||
/// can stretch one whole measurement (the Linux runner read 24.9x of the
|
||||
/// 24x limit once, with 1.35x between two neighbouring sizes); a
|
||||
/// quadratic conversion measures ~64x every time, so asking again
|
||||
/// loosens nothing the test can see.
|
||||
const ATTEMPTS: usize = 3;
|
||||
|
||||
/// Fails unless the cost at the largest size is within [`GROWTH_SLACK`]
|
||||
/// of linear growth from the smallest.
|
||||
/// of linear growth from the smallest, in one of [`ATTEMPTS`] measurements.
|
||||
#[track_caller]
|
||||
fn assert_grows_linearly(sizes: &[u32], costs: &[Duration], what: &str) {
|
||||
for (size, cost) in sizes.iter().zip(costs) {
|
||||
eprintln!("{what}: {size} → {cost:?}");
|
||||
}
|
||||
fn assert_grows_linearly(
|
||||
sizes: &[u32],
|
||||
what: &str,
|
||||
mut measure: impl FnMut() -> Vec<Duration>,
|
||||
) {
|
||||
let (first, last) = (sizes[0], sizes[sizes.len() - 1]);
|
||||
let input = f64::from(last) / f64::from(first);
|
||||
let growth =
|
||||
costs[costs.len() - 1].as_secs_f64() / costs[0].as_secs_f64().max(f64::MIN_POSITIVE);
|
||||
assert!(
|
||||
growth <= GROWTH_SLACK * input,
|
||||
"{what}: {input}x the input cost {growth:.1}x the time ({costs:?}) — \
|
||||
more than {GROWTH_SLACK}x linear, the quadratic conversion is back"
|
||||
let mut seen = Vec::new();
|
||||
for _ in 0..ATTEMPTS {
|
||||
let costs = measure();
|
||||
for (size, cost) in sizes.iter().zip(&costs) {
|
||||
eprintln!("{what}: {size} → {cost:?}");
|
||||
}
|
||||
let growth = costs[costs.len() - 1].as_secs_f64()
|
||||
/ costs[0].as_secs_f64().max(f64::MIN_POSITIVE);
|
||||
if growth <= GROWTH_SLACK * input {
|
||||
return;
|
||||
}
|
||||
seen.push((growth, costs));
|
||||
}
|
||||
panic!(
|
||||
"{what}: {input}x the input cost more than {GROWTH_SLACK}x linear in each of \
|
||||
{ATTEMPTS} measurements ({seen:?}) — the quadratic conversion is back"
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user