Say a length that is zero, and share the seed a scan takes

A full sweep of #19, and the first review of f48e04e.

`Display for LayoutLen` leaves out every part that is zero, so
`LayoutLen::ZERO` printed as the empty string -- and `Debug` forwards to
`Display` since the last commit, so the four `assert_eq!`s in
`cases/deferred.rs` print nothing where a request of zero is, and
`scenario::describe` prints a `.width(0)` rule as `-`, which is what it
prints for a widget that has no rule at all. That file exists so a tree a
fuzzer found can be written out by hand; a value it cannot say is a hole in
the one thing it is for.

`Fixed::ceil_from_f32` took `next_up` of a `from_f32` that had already
clamped, and `next_up` wraps, so a measurement past the top of the grid came
back as the bottom of it. `from_f32` clamps deliberately because a float has
further to come from; the ceiling is the other way in from a float and now
holds to the same rule. The check goes beside the one `from_f32` already
had.

`Moves::depth` walked the move chain a second way, with its own copy of
`CHAIN_LIMIT` and without the assertion `walk` makes; it is `walk` now, so
the CPU counts the chain in one place and the shader's constant reaches
both.

`Harness::set_len` said it set a length "the way `.width()` sets one" and
wrote the whole rule instead, dropping any bound beside it. A case that set
a bound and then a length would have passed with no bound at all.

Three rigs each spelled "one seed, or a range of them" by hand -- the class
the eleventh sweep closed for reading a parameter and not for this. There is
one `rig::seeds` now. `cases/deferred` was last in `suite.rs`'s otherwise
alphabetical list.

`diag::outside` writes out `AxisHolds::contains`'s four clauses to say which
one refused a reuse; a debug assertion now catches a fifth clause added
there and not here, which would leave a refusal counted and unexplained.

`Sow::bound`'s comment recorded an open hole reached by seeds 4 and 196 at
depth 5 -- but `generated.rs` says seeds stopped naming those trees when the
leaves grew images, and 600 depth-5 trees over all sixteen cases agree warm
against cold with every bound a fraction. The comment says what is true now
and why the generator still grows pixels.

Format, workspace clippy under -D warnings with and without
layout-diagnostics, 208 ordinary and 212 diagnostic tests (207 and 211
before, plus the one this adds), and the cold dump byte-identical to
f48e04e across all 34,986 boxes. The three seed scans were not run: nothing
here can move a box, which the dump confirms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Opus 5 committed 2026-09-20 22:04:07 -04:00
1 parent f48e04ed36
commit cbccfb600a
11 files changed
+80 -44

No files matched your search

+1 -5
View File
@@ -6,12 +6,8 @@ use iris::prelude::*;
use iris::random::{Edits, Plan, plan};
fn check_requests(edit: impl Fn(&mut Plan) + Sync) {
let count = rig::env("IRIS_DEFERRED_SEEDS", 20_u64);
let depth = rig::env("IRIS_DEFERRED_DEPTH", 4_usize);
let seeds = std::env::var("IRIS_DEFERRED_SEED")
.ok()
.and_then(|seed| seed.parse().ok())
.map_or_else(|| (1..=count).collect(), |seed| vec![seed]);
let seeds = rig::seeds("IRIS_DEFERRED_SEED", "IRIS_DEFERRED_SEEDS", 20);
scenario::over_seeds(seeds, |seed| {
let mut grown = plan(seed, depth, &Edits::default());
edit(&mut grown);
+1 -7
View File
@@ -113,13 +113,7 @@ fn adding_and_removing_span_children_lands_where_growing_it_that_way_would() {
#[ignore = "as many seeds as it is asked for, rather than the ten the others check"]
fn a_long_run_of_seeds_agrees() {
let depth = depth();
let seeds: Vec<u64> = match std::env::var("IRIS_GENERATED_SEED")
.ok()
.and_then(|v| v.parse().ok())
{
Some(seed) => vec![seed],
None => (1..=env("IRIS_GENERATED_SEEDS", 100_u64)).collect(),
};
let seeds = rig::seeds("IRIS_GENERATED_SEED", "IRIS_GENERATED_SEEDS", 100);
over_seeds(seeds, |seed| {
let grown = plan(seed, depth, &Edits::default());
for case in ALL {
+13
View File
@@ -10,3 +10,16 @@ pub fn env<T: std::str::FromStr>(name: &str, fallback: T) -> T {
.and_then(|value| value.parse().ok())
.unwrap_or(fallback)
}
/// The seeds a scan runs: the one `one` names on its own, or `1..=` the
/// count `many` gives. One seed replaces the range rather than narrowing
/// it, which is how a tree a scan failed on is run again by itself.
// This module is compiled into each rig target separately, so a helper the
// measurement rigs have no seeds to choose is dead code in those builds.
#[allow(dead_code)]
pub fn seeds(one: &str, many: &str, count: u64) -> Vec<u64> {
match std::env::var(one).ok().and_then(|seed| seed.parse().ok()) {
Some(seed) => vec![seed],
None => (1..=env(many, count)).collect(),
}
}
+1 -7
View File
@@ -60,13 +60,7 @@ fn cases() -> Vec<Case> {
fn no_grown_tree_lays_out_differently_warm_than_cold() {
let depth: usize = env("SHRINK_DEPTH", 5);
let cases = cases();
let seeds: Vec<u64> = match std::env::var("SHRINK_SEED")
.ok()
.and_then(|v| v.parse().ok())
{
Some(seed) => vec![seed],
None => (1..=env("SHRINK_SEEDS", 400_u64)).collect(),
};
let seeds = rig::seeds("SHRINK_SEED", "SHRINK_SEEDS", 400);
let count = seeds.len();
over_seeds(seeds, |seed| {
+2 -3
View File
@@ -8,6 +8,8 @@
//! The rigs stay their own targets: `shrink` and `generated` are fuzzers run
//! on their own, and the `*_cost` and `*_diagnostics` ones are measurements.
#[path = "cases/deferred.rs"]
mod deferred;
#[path = "cases/determinism.rs"]
mod determinism;
#[path = "cases/drift.rs"]
@@ -32,6 +34,3 @@ mod tasks;
mod text_edit;
#[path = "cases/unsettled.rs"]
mod unsettled;
#[path = "cases/deferred.rs"]
mod deferred;