Commits
Commits on
7eb6d3444aefa0dfd66f545444f239c0baaaa7ccFiltered to crates/ec-av1/src/stack_budget.rsClear filterToday
2026-10-23
Restore edith_codecs after local data loss (2026-10-23)Ahmet Kaan Gümüş · b7434a2
Restore edith_codecs after local data loss (2026-10-23) On 2026-10-23 an automated agent ran `rm -rf $HOME` and deleted the local repository with all of its history. This commit restores the working tree from the newest surviving copy, the host-c server lane mirror. That mirror matches local main as of the testcut Phase 2 reports, including the tool cache, the nextest fast profile and changed-crates.sh. The history before this commit was not recovered.
2026-10-03
ec-av1: the full suite found three real gaps the scoped runs never sawAhmet Kaan Gümüş · a668ef2
ec-av1: the full suite found three real gaps the scoped runs never saw The server suite at the merged head (wave13) went 776/3/49 and BOTH hosts failed the same three tests, so these are tree defects, not flakes: - refusal_inventory: the BLOCK_INVALID subsize refusal added by lane-av1unwritten and lane-av1subsizesweep was never inventoried. The scanner collects the reason string from unsupported(...) joining line continuations, and it keeps escaped quotes, so the entry is written in the scanner's form. - stack_budget: dumpio.rs landed without being registered in the by-value scan's FILES, so the sweep was blind to any by-value return landing in it. Registered. - stream::tests::allocdet_child_decode: another child-helper test that asserted its ALLOCDET_FIXTURES unconditionally and reddened every full suite -- the same class as the 1f4fcc84 hotfix, shipped one lane later. It now returns with a printed skip when invoked without the parent-set variable; the parent still fails when the child prints no census line, so the skip cannot hide a broken child. Swept: the four child helpers in the crate (dumpio x2, uwdep, allocdet) are all guarded now.
2026-09-30
lane-av1stacksweep: sweep the by-value class, gate it on a measured budget, box Encoded and Av1Encoder::carried_cdfsAhmet Kaan Gümüş · 74a9f69
lane-av1stacksweep: sweep the by-value class, gate it on a measured budget, box Encoded and Av1Encoder::carried_cdfs
THE CLASS, NAMED: a large struct returned BY VALUE from a public constructor is
a stack cost paid by the CALLER, and the constructors NEST, so one value's size
is the multiplier and the chain length is the other factor. Av1Encoder was
139960 bytes by value and aborted on libtest's 2 MiB thread, twice, on
unmodified main. lane-av1enchang fixed that ONE struct and gated that ONE
constructor. Nobody swept the class, and nothing said which types were checked.
THE FIX, same shape as lane-av1enchang (99750756) which boxed DpbSlot::cdfs.
Boxing the per-slot CdfSnapshot left two more copies of the same 15232-byte
table sitting inline, and nobody had measured either:
Encoded::start_cdfs / next_cdfs CdfSnapshot -> Box<CdfSnapshot>
Av1Encoder::carried_cdfs Option<CdfSnapshot> -> Option<Box<..>>
Encoded 30728 -> 280 bytes (99.2% was those two fields)
Av1Encoder 18168 -> 2944 bytes (15232 of it was carried_cdfs)
The VALUES are untouched, so the bitstream is byte-identical. The two fields
and CdfSnapshot itself are pub(crate), so this is NOT a breaking API change:
grep over crates/ finds no reader of either field outside ec-av1, and Encoded's
public fields (stream, reconstruction, modes, inter_block_share) keep their
types. refresh() now hands the already-boxed snapshot to the DPB slot instead
of boxing a second time.
THE SWEEP, crates/ec-av1/src/stack_budget.rs, 8 tests, 0.10s:
the_measured_inventory_is_accurate 21 by-value types, measured, and the
table PRINTS sorted so one command
reproduces the whole inventory
every_by_value_type_fits_the_stack_budget the bound, asserted BY NAME
the_deepest_by_value_constructors_fit_on_a_tight_stack
capability: both deepest public
chains really constructed on a 1 MiB
thread, so a regression ABORTS
every_by_value_public_return_is_in_the_inventory
source scan over 38 modules; a new
by-value pub return reds unmeasured
every_by_value_module_is_scanned the scan's file list derived from
lib.rs -- it immediately named 15
modules the scan was not reading
the_inventory_scan_is_not_vacuous control; it caught a live bug in the
matcher (Result<T, E> parsed as the
name "T, E")
the_crate_private_cdf_tables_stay_behind_a_box
pins the four Box<> declarations
test_threads_get_the_stack_they_are_given
the 2101248-byte floor the bound is
derived from, read from /proc, not
assumed
THE BOUND: 8192 bytes, derived from measurement at BOTH ends and asserted at
both ends. Bounded quantity is what a caller can owe: 2101248 bytes (measured,
/proc/self/task/<tid>/maps) x a 4-deep public chain x an eighth-of-the-stack
share, with the worst public return at 2944 B = 35.9% of budget. The test
asserts DEEPEST_PUBLIC_CHAIN * worst * 8 <= 2 MiB so the derivation cannot rot.
Catches: pre-fix Av1Encoder 17.1x over, Encoded-before-this-lane 3.75x over,
and ec_opus::Encoder (measured in a sibling crate by the same sweep) 10.6x
over. The crate-private Cdfs/CdfSnapshot are measured and listed but NOT
bounded, because no pub fn returns them -- bounding them would calibrate the
number to something no caller can reach.
MUTATION-PROVEN, both reverted and both re-run after the refactor:
unbox DpbSlot::cdfs (revert 99750756) -> "Av1Encoder is 139960 bytes, over
the 8192-byte by-value stack budget (17.09x)" by name, plus SIGABRT
grow Encoded by a 64 KiB inline payload -> "Encoded is 96264 bytes, over
the ... budget (11.75x)" by name, plus SIGABRT
THE CAP: the 64 MiB RUST_MIN_STACK in .cargo/config.toml was protecting
exactly this and no longer needs to. One debug test genuinely needed >2 MiB --
encoder::tests::the_facade_codes_the_same_bytes_as_encode_sequence, 2097152
red / 3145728 green -- and THIS COMMIT FIXES IT: it now passes at 2 MiB. A
799-test per-test sweep at RUST_MIN_STACK=2097152 is in the lane report. I am
not editing .cargo/config.toml, as chartered; the report carries the exact
replacement comment and states that its current wording is wrong (the state it
blames is Vec/VecDeque, i.e. heap; the only fixed-size stack local in the
encoder path is a `const` in film_grain.rs).
Measured deepest chain: 786432 bytes before, 475136 after (1 MiB gate is now
2.2x margin, was 1.33x). The ~470 KB that remains is the encode search's own
frames.
No decode.rs. No bitstream change. No .cargo/config.toml edit. No rustfmt.
Lane report: lanes/av1stacksweep.report.md.