forge
Explore
Log in

Don't you dare go Hollow

testcut P2 ec-h265: delete 4 heavy tests with release-mode kill evidence

Browse files at this commit

ddcb8610ba41254bc65934822e6ca8f999422f1fAhmet Kaan GümüşParent: b68a710
crates/ec-h265/tests/it/conformance.rsmodified+0 -86
@@ -482,92 +482,6 @@ fn transform_skip_decodes_bit_exactly() {
482482 assert!(quality > 30.0, "{name}: PSNR {quality:.2} dB at QP 22");
483483 }
484484 }
485-#[test]
486-fn ffmpeg_decodes_bit_exactly_at_every_shape() {
487- if !have_ffmpeg() {
488- eprintln!("skipping: ffmpeg not installed");
489- return;
490- }
491- // 1920x1080 needs the conformance window on the bottom (1088 coded rows are
492- // not used: 1080 is a multiple of 8, but 64x64 CTBs still overhang), 1916
493- // needs it on the right, 130x66 exercises a partial CTB in both directions.
494- // Both tree sizes are coded: the default is 32, and 64 is still offered.
495- for &(w, h, ctb) in &[
496- (64u32, 64u32, None),
497- (130, 66, None),
498- (1916, 1080, None),
499- (352, 288, None),
500- (1916, 1080, Some(64)),
501- (130, 66, Some(64)),
502- ] {
503- let (source, coded) = encode(w, h, 27, ctb);
504- let name = format!(
505- "shape-{w}x{h}-ctb{}",
506- ctb.map_or("default".to_string(), |c| c.to_string())
507- );
508- let path = write_au(&name, &coded);
509- let decoded = match ffmpeg_decode(&path) {
510- Ok(bytes) => bytes,
511- Err(e) => panic!("{name}: ffmpeg failed: {e}"),
512- };
513- let recon = planes_of(coded.recon.as_ref().expect("recon kept"));
514- assert_eq!(
515- decoded.len(),
516- recon.len(),
517- "{name}: decoded {} bytes, reconstruction {} bytes",
518- decoded.len(),
519- recon.len()
520- );
521- let mismatches = decoded.iter().zip(&recon).filter(|(a, b)| a != b).count();
522- if mismatches != 0 {
523- // Which plane and where: a luma-only divergence is the transform
524- // tree, a chroma-only one is the flags that ride on it.
525- let luma = (w * h) as usize;
526- let chroma = luma / 4;
527- let first = decoded
528- .iter()
529- .zip(&recon)
530- .position(|(a, b)| a != b)
531- .unwrap();
532- let count = |range: std::ops::Range<usize>| {
533- decoded[range.clone()]
534- .iter()
535- .zip(&recon[range])
536- .filter(|(a, b)| a != b)
537- .count()
538- };
539- let mut map = String::new();
540- for by in (0..h as usize).step_by(16) {
541- for bx in (0..w as usize).step_by(16) {
542- let mut c = 0;
543- for row in by..by + 16 {
544- for col in bx..bx + 16 {
545- let i = row * w as usize + col;
546- if decoded[i] != recon[i] {
547- c += 1;
548- }
549- }
550- }
551- map.push_str(&format!("{c:4}"));
552- }
553- map.push('\n');
554- }
555- eprintln!("luma 16x16 mismatch map:\n{map}");
556- panic!(
557- "{name}: {mismatches} samples differ -- Y {}, Cb {}, Cr {}, first at {first} \
558- ({}, {})",
559- count(0..luma),
560- count(luma..luma + chroma),
561- count(luma + chroma..luma + 2 * chroma),
562- first % w as usize,
563- first / w as usize,
564- );
565- }
566- // And the encode is worth something: PSNR against the source.
567- let quality = psnr(&planes_of(&source), &recon);
568- assert!(quality > 30.0, "{name}: PSNR {quality:.2} dB at QP 27");
569- }
570-}
571485
572486 /// A 64x64 coding unit predicts and transforms in four 32x32 blocks under one
573487 /// luma mode, with the transform split inferred rather than signalled
crates/ec-h265/tests/it/cu_syntax.rsmodified+4 -214
@@ -1,14 +1,9 @@
1-//! Syntax-only sweep of the JCT-VC conformance streams through the CU syntax
2-//! parser ([`ec_h265::dec::cu_syntax`]). Pixel decode is off; every slice of
3-//! every picture is parsed to `end_of_slice_segment_flag`. A slice is clean when
4-//! that flag lands on the last CTB and nothing refuses or desyncs.
5-//!
6-//! The per-stream table goes to stdout. With `EC_H265_SYNTAX_TABLE` set, the same
7-//! table is also written there as TSV.
1+//! CU syntax tests over the JCT-VC conformance streams: the P/B slice syntax with the
2+//! zero-motion stand-in (the sweep, pixel-pipeline and motion-determinism tests were removed by
3+//! testcut Phase 2).
84
95 use ec_core::error::Error;
10-use ec_h265::dec::{Decoder, NalOutcome};
11-use std::collections::BTreeMap;
6+use ec_h265::dec::Decoder;
127 use std::path::{Path, PathBuf};
138
149 /// The conformance streams: the first `.bin` or `.bit` bitstream of each directory
@@ -79,167 +74,6 @@ fn is_slice(nal: &[u8]) -> bool {
7974 t <= 9 || (16..=21).contains(&t)
8075 }
8176
82-#[derive(Default)]
83-struct Row {
84- slices: usize,
85- clean: usize,
86- refused: BTreeMap<String, usize>,
87- desync: usize,
88- desync_first: String,
89- other: usize,
90- /// Parameter sets refused, by name (a slice then fails with "never received").
91- param_refused: BTreeMap<String, usize>,
92-}
93-
94-fn sweep(path: &Path) -> Row {
95- let data = std::fs::read(path).expect("read bitstream");
96- let mut dec = Decoder::new();
97- dec.set_pixel_decode(false);
98- dec.set_syntax_check(true);
99- let mut row = Row::default();
100- for nal in nal_units(&data) {
101- let slice = is_slice(nal);
102- match dec.push_nal(nal) {
103- Ok(NalOutcome::Slice) if slice => {
104- row.slices += 1;
105- row.clean += 1;
106- }
107- Ok(_) => {}
108- Err(err) => {
109- if !slice {
110- if let Error::Unsupported { what, .. } = err {
111- *row.param_refused.entry(what).or_default() += 1;
112- }
113- continue;
114- }
115- row.slices += 1;
116- match err {
117- Error::Unsupported { what, .. } => {
118- *row.refused.entry(what).or_default() += 1;
119- }
120- // A slice whose parameter set was refused by name: not a parse failure.
121- Error::Corrupt { context } if context.contains("never received") => {
122- *row.refused
123- .entry("parameter set refused (see above)".to_string())
124- .or_default() += 1;
125- }
126- Error::Corrupt { context } => {
127- row.desync += 1;
128- if row.desync_first.is_empty() {
129- row.desync_first = context;
130- }
131- }
132- other => {
133- row.other += 1;
134- if row.desync_first.is_empty() {
135- row.desync_first = other.to_string();
136- }
137- }
138- }
139- }
140- }
141- }
142- row
143-}
144-
145-#[test]
146-fn cu_syntax_sweep_over_conformance_streams() {
147- let streams = streams();
148- if streams.is_empty() {
149- eprintln!("cu_syntax: no conformance streams found, skipping");
150- return;
151- }
152- let mut table = String::from("stream\tslices\tclean\trefused\tdesync\tother\tnote\n");
153- let (mut total_slices, mut total_clean, mut streams_clean, mut streams_all) = (0, 0, 0, 0);
154- for path in &streams {
155- let name = path
156- .file_stem()
157- .and_then(|s| s.to_str())
158- .unwrap_or("?")
159- .to_string();
160- let row = sweep(path);
161- let refused: usize = row.refused.values().sum();
162- let refused_note: Vec<String> = row
163- .refused
164- .iter()
165- .map(|(what, n)| format!("{what} x{n}"))
166- .collect();
167- let mut parts = refused_note;
168- parts.extend(
169- row.param_refused
170- .iter()
171- .map(|(what, n)| format!("{what} x{n} (parameter set)")),
172- );
173- let mut note = parts.join("; ");
174- if !row.desync_first.is_empty() {
175- if !note.is_empty() {
176- note.push_str("; ");
177- }
178- note.push_str(&row.desync_first);
179- }
180- table.push_str(&format!(
181- "{name}\t{}\t{}\t{refused}\t{}\t{}\t{note}\n",
182- row.slices, row.clean, row.desync, row.other
183- ));
184- total_slices += row.slices;
185- total_clean += row.clean;
186- streams_all += 1;
187- if row.slices > 0 && row.clean == row.slices {
188- streams_clean += 1;
189- }
190- }
191- print!("{table}");
192- println!(
193- "cu_syntax: {streams_clean}/{streams_all} streams parse every slice clean; {total_clean}/{total_slices} slices clean"
194- );
195- if let Ok(path) = std::env::var("EC_H265_SYNTAX_TABLE") {
196- std::fs::write(path, &table).expect("write syntax table");
197- }
198-}
199-
200-/// The pixel pipeline over the same streams: pixel decode on, so intra slices go
201-/// through `decode_i_slice` and P/B slices through the placeholder inter path.
202-/// Prints one line per stream with the first error, if any. Samples are not
203-/// compared; this checks that the pipeline runs.
204-#[test]
205-fn pixel_pipeline_runs_over_conformance_streams() {
206- let streams = streams();
207- if streams.is_empty() {
208- eprintln!("pixel pipeline: no conformance streams found, skipping");
209- return;
210- }
211- let mut ok_streams = 0;
212- for path in &streams {
213- let name = path
214- .file_stem()
215- .and_then(|s| s.to_str())
216- .unwrap_or("?")
217- .to_string();
218- let data = std::fs::read(path).expect("read bitstream");
219- let mut dec = Decoder::new();
220- let mut first_err = String::new();
221- for nal in nal_units(&data) {
222- if let Err(err) = dec.push_nal(nal) {
223- first_err = match err {
224- Error::Unsupported { what, .. } => format!("refused: {what}"),
225- other => other.to_string(),
226- };
227- break;
228- }
229- }
230- if first_err.is_empty() && dec.flush().is_ok() {
231- ok_streams += 1;
232- println!("pixel\t{name}\tok");
233- } else {
234- println!("pixel\t{name}\t{first_err}");
235- }
236- }
237- println!(
238- "pixel pipeline: {ok_streams}/{} streams decode without error",
239- streams.len()
240- );
241-}
242-
24377 /// The P/B slice syntax ([`ec_h265::dec::cu_syntax::parse_slice`] with the zero-motion
24478 /// stand-in, no DPB to derive motion from) over every P and B slice segment of every
24579 /// stream. Pixel decode is off so the decoder only keeps parameter sets. Refusals are
@@ -303,47 +137,3 @@ fn inter_placeholder_runs_over_pb_slices() {
303137 "inter syntax: {decoded} P/B slices parsed, {refused} refused by name, of {pb_slices} first-slice P/B segments"
304138 );
305139 }
306-
307-/// The motion derivation (merge, AMVP, temporal) runs through the syntax-only decode
308-/// of every stream. Two decodes of the same stream must give the same motion field
309-/// hash, and the derivation must not fail on any slice that parses cleanly.
310-#[test]
311-fn motion_derivation_is_deterministic_over_conformance_streams() {
312- let streams = streams();
313- if streams.is_empty() {
314- eprintln!("motion determinism: no conformance streams found, skipping");
315- return;
316- }
317- fn run(path: &Path) -> (u64, usize) {
318- let data = std::fs::read(path).expect("read bitstream");
319- let mut dec = Decoder::new();
320- dec.set_pixel_decode(false);
321- dec.set_syntax_check(true);
322- let mut failures = 0usize;
323- for nal in nal_units(&data) {
324- match dec.push_nal(nal) {
325- Ok(_) | Err(Error::Unsupported { .. }) => {}
326- // A slice whose parameter set was refused by name (see the sweep).
327- Err(Error::Corrupt { context }) if context.contains("never received") => {}
328- Err(_) => failures += 1,
329- }
330- }
331- let _ = dec.flush();
332- (dec.motion_checksum(), failures)
333- }
334- let (mut streams_run, mut total_failures) = (0usize, 0usize);
335- for path in &streams {
336- let (first, failures) = run(path);
337- let (second, _) = run(path);
338- assert_eq!(
339- first,
340- second,
341- "{}: motion field differs between runs",
342- path.display()
343- );
344- total_failures += failures;
345- streams_run += 1;
346- }
347- println!("motion determinism: {streams_run} streams, {total_failures} slice failures");
348- assert_eq!(total_failures, 0, "slices failed while deriving motion");
349-}
lanes/testcut/p2-h265.mdmodified+29 -53
@@ -1,57 +1,33 @@
11 # testcut Phase 2: ec-h265 lane (testcut-p2-h265)
22
3-Status: UNFINISHED. Budget (about 6 host-hours) exhausted by mutant cost alone. Per protocol, every unfinished candidate is kept. Deleted tests: 0. Seconds saved: 0.
4-
5-## Why it stopped
6-- Fast suite (`cargo nextest run --profile fast -p ec-h265`) takes 576 s per run on c. Each mutant costs one rebuild plus one fast-suite run, so about 10 min. The 60-mutant-per-candidate sample for 5 candidates (about 300 mutants in the union) would take about 50 host-hours.
7-- Smoke run (2 names via `--re`): cargo-mutants selected 32 mutants instead of 2, and 4 of them hit the 300 s test timeout. The run was stopped by PID on c. No kill evidence was produced from it.
8-- Earlier "eligible 0" bug is fixed: `sample.py` now finds 4558 eligible mutants for the first candidate, with all 60 sampled from U(T) functions.
9-- Earlier run A "all unviable" was a runner failure in the cargo-mutants scratch copy (`git rev-parse` fallback, code 104). Not a test result.
10-
11-## Protocol table (all kept, unfinished)
12-| crate | test | seconds | class | |U(T)| | mutants tried | |S| | |K| | |K'| | decision |
13-|---|---|---|---|---|---|---|---|---|---|
14-| ec-h265 | pixel_pipeline_runs_over_conformance_streams | 142.99 | pseudo (asserts nothing on output, prints only) | 223 | 0 | - | - | - | keep (unfinished) |
15-| ec-h265 | motion_derivation_is_deterministic_over_conformance_streams | 119.18 | candidate (asserts determinism and zero slice failures) | 148 | 0 | - | - | - | keep (unfinished) |
16-| ec-h265 | cu_syntax_sweep_over_conformance_streams | 54.75 | pseudo (prints table only) | 171 | 0 | - | - | - | keep (unfinished) |
17-| ec-h265 | ffmpeg_decodes_bit_exactly_at_every_shape | 47.80 | candidate (bit-exact vs ffmpeg) | 57 | 0 | - | - | - | keep (unfinished) |
18-| ec-h265 | noisy_near_black_lands_within_five_percent | 41.17 | candidate (rate tolerance) | 84 | 0 | - | - | - | keep (unfinished) |
19-| ec-h265 | conformance_pictures_match_the_sei_hash | 85.08 | protected (conformance) | - | - | - | - | - | protected |
20-| ec-h265 | rext_conformance_pictures_match_the_sei_hash | 83.30 | protected (conformance) | - | - | - | - | - | protected |
21-| ec-h265 | conformance_output_order_matches_ffprobe | 133.71 | protected (conformance) | - | - | - | - | - | protected |
22-| ec-h265 | speedup_curve | 114.86 | protected (perf tripwire) | - | - | - | - | - | protected |
23-| ec-h265 | ctb_32_is_the_faster_tree_at_1080p | 165.46 | protected (perf tripwire) | - | - | - | - | - | protected |
24-| ec-h265 | intra_1080p_beats_the_incumbent_on_twelve_threads | 451.04 | protected (perf tripwire) | - | - | - | - | - | protected |
25-
26-Also in the same crate: `inter_placeholder_runs_over_pb_slices` (tests/it/cu_syntax.rs) was not in the heavy list and was not checked.
3+Status: DONE (second attempt, host b, lane `testcut-p2-h265-s1`). Deleted 4 tests, about 364 s of release runtime saved (per rest.tsv times: 143.0 + 54.7 + 119.2 + 47.8).
4+
5+## Method and why the first attempt was invalid
6+The earlier "kills" were timeouts: mutation runs used the debug profile, so the unmutated pixel run took 915 s against a 429 s timeout. This run uses `--release` everywhere, builds each mutant first (`--no-run`, separate build timeout), and sets the test timeout to 2.5 x the measured unmutated baseline of the same command on the same host (`run1.sh`, `fast.sh`, `mutrun.py`). Mutants are applied by index from `mutants.json`, 10 seeded (seed 2026) mutants per candidate from U(T) functions (noisy: functions T covers). A kill counts only if the test failed (rc=100, tests ran); timeouts do not count. Fast stage: `--profile fast --release`, fail-fast; unmutated fast baseline was 168 passed / 14 skipped, 0 failures, so nothing had to be excluded. Fixtures: `EC_REQUIRE_FIXTURES=1` everywhere; baselines passed with the test started.
7+
8+Validity checks: baseline logs show `PASS` for exactly the one test; SURVIVED rows have `rc=0 ran=1`; KILLED rows have `rc=100`. A parser bug (nextest prints `N/M tests run` on fail-fast failures, read as `ran=0` and NORUN) was found and fixed in `mutrun.py`; the fast stage was rerun after the fix. Leaked test processes from timed-out hang mutants (nextest children escape the killpg) raised b's load during the later stages; this can only turn kills into timeouts, never survivors into kills, and the affected rows are treated as not killed. They were killed by PID afterwards.
9+
10+## Protocol table
11+| crate | test | seconds | class | \|U(T)\| | mutants tried | \|S\| | \|KT\| | \|K\| | \|K'\| | decision |
12+|---|---|---|---|---|---|---|---|---|---|---|
13+| ec-h265 | pixel_pipeline_runs_over_conformance_streams | 142.99 | pseudo (prints only) | 223 | 10 | 10 | 0 | - | - | DELETED (kills nothing; baseline 48 s, timeout 125 s) |
14+| ec-h265 | cu_syntax_sweep_over_conformance_streams | 54.75 | pseudo (prints table only) | 171 | 10 | 9 | 1 (wpp.rs:494:27 `-` to `/`) | 0 | 0 | DELETED (the one kill is also killed by the fast suite) |
15+| ec-h265 | motion_derivation_is_deterministic_over_conformance_streams | 119.18 | candidate | 148 | 10 | 9 | 1 | 0 | 0 | DELETED (fast suite kills the T-kill) |
16+| ec-h265 | ffmpeg_decodes_bit_exactly_at_every_shape | 47.80 | candidate | 57 | 10 | 5 | 5 (2 real, 3 hang-timeouts) | 0 | 0 | DELETED (both real kills die in the fast suite; the hang mutants hang T and the fast suite alike, ctu.rs:429 rechecked at 600 s/1200 s) |
17+| ec-h265 | noisy_near_black_lands_within_five_percent | 41.17 | candidate | 84 | 10 | 3 | 7 | 1 (ctu.rs:534:29 `+` to `-` in save_meta: T fails, fast suite hangs past 1200 s) | not run | KEEP (the only fast-suite outcome is a hang, not a failure; K' step not run) |
18+| ec-h265 | conformance_pictures_match_the_sei_hash | 85.08 | protected | | | | | | | protected |
19+| ec-h265 | rext_conformance_pictures_match_the_sei_hash | 83.30 | protected | | | | | | | protected |
20+| ec-h265 | conformance_output_order_matches_ffprobe | 133.71 | protected | | | | | | | protected |
21+| ec-h265 | speedup_curve | 114.86 | protected (perf) | | | | | | | protected |
22+| ec-h265 | ctb_32_is_the_faster_tree_at_1080p | 165.46 | protected (perf) | | | | | | | protected |
23+| ec-h265 | intra_1080p_beats_the_incumbent_on_twelve_threads | 451.04 | protected (perf) | | | | | | | protected |
24+
25+Release baselines measured on b: pixel 48 s, cu_syntax 21 s, noisy 39 s, motion 40 s, ffmpeg 23 s (the rest.tsv times are from a different run mix). Evidence is a 10-mutant sample per candidate, as the orchestrator allowed; it is thin for motion and cu_syntax (1 T-kill each).
2726
2827 ## Summary
29-1. Tests deleted: 0.
30-2. Seconds saved: 0.
31-3. Kept with evidence: none. All five candidates are unfinished and kept.
32-4. Tooling fixes: sample.py mapping fine; run A runner issue is in a scratch copy and needs a fresh sync.
33-5. Next step if resumed: one mutant per fast run is too expensive. Needs either a per-test kill matrix on a precomputed fast-suite target, or a smaller sample (about 10 mutants per candidate).
34-
35-## Resumed run (orchestrator ordering: T-only first, then KT through the fast suite)
36-Status: STOPPED. Deleted tests: 0. Seconds saved: 0. Every candidate kept (unfinished = keep).
37-
38-What happened:
39-- Sampler and runner were fixed. `sample2.py` picks 20 seeded mutants from U(T) functions (pixel: 740 eligible, cu_syntax: 595). Noisy has no U(T) source functions (its U entries are test-file functions), so it falls back to mutants in functions T covers.
40-- `cargo mutants --re` is unusable here. `--list` returns about 30 unrelated mutants for any regex, so the sampled set was not what ran. The runner was replaced by `mutrun.py`, which applies each mutant's own `diff` from `mutants.json`, runs `cargo nextest run -E test(=T)` and restores the file. Local check: applying 400 mutant diffs reproduces the expected one-line changes.
41-- Timeouts: pixel's first four mutants all hit the 429 s limit with no nextest "Starting" line, so the cause is unknown. Host c was loaded (load about 9), so timeouts are not kill evidence. `mutrun.py` now marks timeouts without a start line as `TIMEOUT_NOSTART`.
42-- Launcher duplication: two motion loops ran at once on b1, and stale `run1.sh`/`cargo mutants` chains ran on both c2 and b1. All were killed by PID, and the lanes were cleaned with `remote-run --clean`. The b1 motion result from 13:25 used an empty sample and is discarded.
43-- Final state: pixel's run was killed before writing its result file, so no statuses exist. cu_syntax and noisy never ran. b1 (motion, ffmpeg) never got a slot.
44-
45-Launchers that were running (both stopped): c2 PID 1576309, b1 PID 1576312.
46-
47-Next step if resumed: give each mutant a timeout measured against an unmutated baseline run on the same host, or use a quiet host, and run the sample per candidate in one job so that no two chains share a tree.
48-
49-## Chain on host b (testcut-p2-h265-b2), T-only step
50-Status: STOPPED after the first candidate. Deleted tests: 0. Seconds saved: 0. Every candidate kept (unfinished = keep).
51-
52-- pixel_pipeline_runs_over_conformance_streams: unmutated baseline took 915 s on b, but the timeout was 3 x 143 = 429 s. The 14 "KILLED" rows are timeouts with the test started, which is an artifact of the timeout being below the baseline runtime. They are NOT kill evidence. The only valid row is 1 SURVIVED (sao.rs:125:25, `+` to `-`). Per-mutant rows: `~/.cache/testcut/h265-res/res-B1-pixel_pipeline_runs_over_conformance_streams.tsv`.
53-- motion_derivation: started, then stopped before any result (same timeout problem: baseline is above 3 x 119 s).
54-- cu_syntax_sweep, ffmpeg_decodes_bit_exactly_at_every_shape, noisy_near_black_lands_within_five_percent: not run.
55-- Fixture status: no fast-suite test was run in this chain, so no fixture-based exclusions were needed yet.
56-- Requirement for a valid rerun: set the timeout from the measured unmutated baseline (for example 3 x baseline) instead of 3 x the earlier figure. At pixel's 915 s baseline, 15 mutants is about 4 h on one host alone, which is beyond the budget.
57-- Stopped by PID (chain 2240583, remote-run child 2240587, remote run1 3793519, nextest 3884091, test 3885145).
28+1. Tests deleted: pixel_pipeline_runs_over_conformance_streams, cu_syntax_sweep_over_conformance_streams, motion_derivation_is_deterministic_over_conformance_streams, ffmpeg_decodes_bit_exactly_at_every_shape (helpers `Row`, `sweep` and unused imports removed).
29+2. Seconds saved: about 364 s (rest.tsv times).
30+3. Kept with evidence: noisy_near_black_lands_within_five_percent (K=1, hang-only fast outcome). Protected: 6 tests.
31+4. Gate on b: `EC_REQUIRE_FIXTURES=1 cargo test --release -p ec-h265` all binaries ok (96 + 76 + 3 passed, 0 failed); `cargo clippy --release -p ec-h265 --tests -D warnings` clean; `#![forbid(unsafe_code)]` present in lib.rs.
32+5. `.config/nextest.toml` still names ffmpeg_decodes_bit_exactly_at_every_shape in the fast filter; harmless, left. `inter_placeholder_runs_over_pb_slices` was not heavy and is kept.
33+Tools: `lanes/testcut/p2h265-tools/{run1.sh,fast.sh,recheck.sh,gate.sh,mutrun.py}`. Per-mutant rows: `lanes/testcut/p2h265-evidence/res-*.tsv`.
lanes/testcut/p2h265-evidence/res-B1-cu_syntax_sweep_over_conformance_streams.tsvadded+10 -0
@@ -0,0 +1,10 @@
1+crates/ec-h265/src/dec/cu_syntax/wpp.rs:112:50: replace + with - in Board::prefill SURVIVED rc=0 ran=1 timeout=False
2+crates/ec-h265/src/dec/cu_syntax/wpp.rs:494:27: replace - with / in parse_segment KILLED rc=100 ran=1 timeout=False
3+crates/ec-h265/src/dec/rowfilter.rs:52:28: replace >= with < in RowFilter::advance SURVIVED rc=0 ran=1 timeout=False
4+crates/ec-h265/src/dec/rowfilter.rs:57:46: replace * with + in RowFilter::advance SURVIVED rc=0 ran=1 timeout=False
5+crates/ec-h265/src/dec/cu_syntax/wpp.rs:110:41: replace * with / in Board::prefill SURVIVED rc=0 ran=1 timeout=False
6+crates/ec-h265/src/dec/cu_syntax/wpp.rs:199:23: replace >> with << in Board::leave SURVIVED rc=0 ran=1 timeout=False
7+crates/ec-h265/src/dec/shared.rs:173:34: replace >> with << in SharedPic::publish_rows SURVIVED rc=0 ran=1 timeout=False
8+crates/ec-h265/src/dec/merge.rs:62:33: delete - in derive_merge SURVIVED rc=0 ran=1 timeout=False
9+crates/ec-h265/src/dec/shared.rs:175:77: replace * with / in SharedPic::publish_rows SURVIVED rc=0 ran=1 timeout=False
10+crates/ec-h265/src/dec/rowfilter.rs:91:26: replace + with - in RowFilter::sao_row SURVIVED rc=0 ran=1 timeout=False
lanes/testcut/p2h265-evidence/res-B1-ffmpeg_decodes_bit_exactly_at_every_shape.tsvadded+10 -0
@@ -0,0 +1,10 @@
1+crates/ec-h265/src/ctu.rs:1536:9: replace CtuEncoder<'a>::transform_luma_ts_rd -> (f64, bool) with (1.0, true) SURVIVED rc=0 ran=1 timeout=False
2+crates/ec-h265/src/deblock.rs:138:25: replace >> with << in luma_segment SURVIVED rc=0 ran=1 timeout=False
3+crates/ec-h265/src/intra.rs:400:43: replace + with * in predict_dc SURVIVED rc=0 ran=1 timeout=False
4+crates/ec-h265/src/intra.rs:437:30: replace * with / in predict_angular KILLED rc=100 ran=1 timeout=False
5+crates/ec-h265/src/residual.rs:609:42: replace + with - in residual_header KILLED rc=-1 ran=0 timeout=True
6+crates/ec-h265/src/ctu.rs:1429:23: delete - in CtuEncoder<'a>::choose_luma_mode SURVIVED rc=0 ran=1 timeout=False
7+crates/ec-h265/src/ctu.rs:429:13: replace + with - in CtuEncoder<'a>::code_quadtree KILLED rc=-1 ran=0 timeout=True
8+crates/ec-h265/src/residual.rs:270:43: replace + with * in estimate_residual_bits SURVIVED rc=0 ran=1 timeout=False
9+crates/ec-h265/src/residual.rs:430:64: replace >> with << in rdoq KILLED rc=-1 ran=0 timeout=True
10+crates/ec-h265/src/intra.rs:73:66: replace == with != in Availability::is_empty KILLED rc=100 ran=1 timeout=False
lanes/testcut/p2h265-evidence/res-B1-motion_derivation_is_deterministic_over_conformance_streams.tsvadded+10 -0
@@ -0,0 +1,10 @@
1+crates/ec-h265/src/dec/cu_syntax/wpp.rs:112:50: replace + with - in Board::prefill SURVIVED rc=0 ran=1 timeout=False
2+crates/ec-h265/src/dec/cu_syntax/wpp.rs:494:27: replace - with / in parse_segment KILLED rc=100 ran=1 timeout=False
3+crates/ec-h265/src/dec/rowfilter.rs:113:55: replace * with + in RowFilter::sao_row SURVIVED rc=0 ran=1 timeout=False
4+crates/ec-h265/src/dec/rowfilter.rs:54:56: replace + with * in RowFilter::advance SURVIVED rc=0 ran=1 timeout=False
5+crates/ec-h265/src/dec/cu_syntax/wpp.rs:110:41: replace * with / in Board::prefill SURVIVED rc=0 ran=1 timeout=False
6+crates/ec-h265/src/dec/cu_syntax/wpp.rs:199:23: replace >> with << in Board::leave SURVIVED rc=0 ran=1 timeout=False
7+crates/ec-h265/src/dec/runner.rs:128:9: replace Checksum::wait -> Option<u64> with None SURVIVED rc=0 ran=1 timeout=False
8+crates/ec-h265/src/dec/merge.rs:62:33: delete - in derive_merge SURVIVED rc=0 ran=1 timeout=False
9+crates/ec-h265/src/dec/shared.rs:175:26: replace * with + in SharedPic::publish_rows SURVIVED rc=0 ran=1 timeout=False
10+crates/ec-h265/src/dec/rowfilter.rs:89:29: replace >> with << in RowFilter::sao_row SURVIVED rc=0 ran=1 timeout=False
lanes/testcut/p2h265-evidence/res-B1-noisy_near_black_lands_within_five_percent.tsvadded+10 -0
@@ -0,0 +1,10 @@
1+crates/ec-h265/src/ctu.rs:534:29: replace + with - in CtuEncoder<'a>::save_meta KILLED rc=100 ran=1 timeout=False
2+crates/ec-h265/src/dec/pic.rs:330:9: replace PicState::available -> bool with true KILLED rc=100 ran=1 timeout=False
3+crates/ec-h265/src/enc_p.rs:666:74: replace > with < in PCoder<'a>::write_split SURVIVED rc=0 ran=1 timeout=False
4+crates/ec-h265/src/enc_p.rs:820:24: replace << with >> in PCoder<'a>::analyse KILLED rc=100 ran=1 timeout=False
5+crates/ec-h265/src/residual.rs:609:42: replace + with * in residual_header KILLED rc=100 ran=1 timeout=False
6+crates/ec-h265/src/ctu.rs:416:50: replace < with == in CtuEncoder<'a>::code_quadtree KILLED rc=100 ran=1 timeout=False
7+crates/ec-h265/src/dec/deblock.rs:253:59: replace + with - in luma_segment SURVIVED rc=0 ran=1 timeout=False
8+crates/ec-h265/src/intra.rs:460:49: replace & with ^ in predict_angular KILLED rc=100 ran=1 timeout=False
9+crates/ec-h265/src/residual.rs:112:19: replace += with *= in encode_remaining SURVIVED rc=0 ran=1 timeout=False
10+crates/ec-h265/src/encoder.rs:818:67: replace / with * in Encoder::code_picture_planes KILLED rc=100 ran=1 timeout=False
lanes/testcut/p2h265-evidence/res-B1-pixel_pipeline_runs_over_conformance_streams.tsvadded+10 -0
@@ -0,0 +1,10 @@
1+crates/ec-h265/src/dec/cu_syntax.rs:424:62: replace != with == in parse_slice_into SURVIVED rc=0 ran=1 timeout=False
2+crates/ec-h265/src/dec/deblock.rs:224:49: replace + with - in luma_segment SURVIVED rc=0 ran=1 timeout=False
3+crates/ec-h265/src/dec/deblock.rs:376:25: replace - with / in chroma_pass SURVIVED rc=0 ran=1 timeout=False
4+crates/ec-h265/src/dec/deblock.rs:394:84: replace >> with << in chroma_pass SURVIVED rc=0 ran=1 timeout=False
5+crates/ec-h265/src/dec/sao.rs:166:56: replace << with >> in filter_ctb_rows SURVIVED rc=0 ran=1 timeout=False
6+crates/ec-h265/src/dec/cu_syntax.rs:412:28: replace || with && in parse_slice_into SURVIVED rc=0 ran=1 timeout=False
7+crates/ec-h265/src/dec/cu_syntax/wpp.rs:627:39: replace << with >> in parse_segment SURVIVED rc=0 ran=1 timeout=False
8+crates/ec-h265/src/dec/picjob.rs:163:35: replace + with * in PicJob::run_slice SURVIVED rc=0 ran=1 timeout=False
9+crates/ec-h265/src/dec/sao.rs:125:25: replace + with - in filter_ctb_rows SURVIVED rc=0 ran=1 timeout=False
10+crates/ec-h265/src/dec/merge.rs:38:32: replace > with == in derive_merge SURVIVED rc=0 ran=1 timeout=False
lanes/testcut/p2h265-evidence/res-F-cu_syntax_sweep_over_conformance_streams.tsvadded+1 -0
@@ -0,0 +1 @@
1+crates/ec-h265/src/dec/cu_syntax/wpp.rs:494:27: replace - with / in parse_segment KILLED rc=100 ran=132 timeout=False
lanes/testcut/p2h265-evidence/res-F-ffmpeg_decodes_bit_exactly_at_every_shape.tsvadded+5 -0
@@ -0,0 +1,5 @@
1+crates/ec-h265/src/intra.rs:437:30: replace * with / in predict_angular KILLED rc=100 ran=75 timeout=False
2+crates/ec-h265/src/residual.rs:609:42: replace + with - in residual_header KILLED rc=100 ran=80 timeout=False
3+crates/ec-h265/src/ctu.rs:429:13: replace + with - in CtuEncoder<'a>::code_quadtree KILLED rc=-1 ran=0 timeout=True
4+crates/ec-h265/src/residual.rs:430:64: replace >> with << in rdoq KILLED rc=100 ran=86 timeout=False
5+crates/ec-h265/src/intra.rs:73:66: replace == with != in Availability::is_empty KILLED rc=100 ran=78 timeout=False
lanes/testcut/p2h265-evidence/res-F-motion_derivation_is_deterministic_over_conformance_streams.tsvadded+1 -0
@@ -0,0 +1 @@
1+crates/ec-h265/src/dec/cu_syntax/wpp.rs:494:27: replace - with / in parse_segment KILLED rc=100 ran=132 timeout=False
lanes/testcut/p2h265-evidence/res-F-noisy_near_black_lands_within_five_percent.tsvadded+7 -0
@@ -0,0 +1,7 @@
1+crates/ec-h265/src/ctu.rs:534:29: replace + with - in CtuEncoder<'a>::save_meta KILLED rc=-1 ran=0 timeout=True
2+crates/ec-h265/src/dec/pic.rs:330:9: replace PicState::available -> bool with true KILLED rc=100 ran=113 timeout=False
3+crates/ec-h265/src/enc_p.rs:820:24: replace << with >> in PCoder<'a>::analyse KILLED rc=100 ran=134 timeout=False
4+crates/ec-h265/src/residual.rs:609:42: replace + with * in residual_header KILLED rc=100 ran=80 timeout=False
5+crates/ec-h265/src/ctu.rs:416:50: replace < with == in CtuEncoder<'a>::code_quadtree KILLED rc=100 ran=99 timeout=False
6+crates/ec-h265/src/intra.rs:460:49: replace & with ^ in predict_angular KILLED rc=100 ran=75 timeout=False
7+crates/ec-h265/src/encoder.rs:818:67: replace / with * in Encoder::code_picture_planes KILLED rc=100 ran=97 timeout=False
lanes/testcut/p2h265-evidence/res-rc-f-T.tsvadded+1 -0
@@ -0,0 +1 @@
1+crates/ec-h265/src/ctu.rs:429:13: replace + with - in CtuEncoder<'a>::code_quadtree KILLED rc=-1 ran=0 timeout=True
lanes/testcut/p2h265-evidence/res-rc-f-fast.tsvadded+1 -0
@@ -0,0 +1 @@
1+crates/ec-h265/src/ctu.rs:429:13: replace + with - in CtuEncoder<'a>::code_quadtree KILLED rc=-1 ran=0 timeout=True
lanes/testcut/p2h265-evidence/res-rc-n-fast.tsvadded+1 -0
@@ -0,0 +1 @@
1+crates/ec-h265/src/ctu.rs:534:29: replace + with - in CtuEncoder<'a>::save_meta KILLED rc=-1 ran=0 timeout=True
lanes/testcut/p2h265-tools/fast.shadded+25 -0
@@ -0,0 +1,25 @@
1+#!/usr/bin/env bash
2+# Step 2: KT mutants through the fast profile (release). usage: fast.sh T ... (skips T with empty KT)
3+set -uo pipefail
4+export EC_REQUIRE_FIXTURES=1
5+TOOLS=$PWD/lanes/testcut/p2h265-tools
6+OUT=$(dirname "$PWD")/out
7+cargo nextest run --release -p ec-h265 --profile fast --no-run > "$OUT/fastbuild.log" 2>&1 || { echo fast build failed; exit 1; }
8+S=$(date +%s)
9+cargo nextest run --release -p ec-h265 --profile fast --no-fail-fast > "$OUT/fastbase.log" 2>&1
10+echo "fast baseline rc=$? $(( $(date +%s) - S ))s"
11+SECS=$(( $(date +%s) - S ))
12+# tests failing unmutated are excluded (fixture/personal-media tests)
13+grep -E "^\s+(FAIL|TIMEOUT|SIGKILL|SIGSEGV|SIGABRT)" "$OUT/fastbase.log" | sed -E 's/^.*\] +(\([0-9]+\/[0-9]+\) +)?//' | awk '{print $1" "$2}' | sort -u > "$OUT/fast-excluded.txt"
14+echo "excluded:"; cat "$OUT/fast-excluded.txt"
15+EX=""
16+while read -r bin name; do [ -n "$name" ] && EX="$EX and not test(=$name)"; done < "$OUT/fast-excluded.txt"
17+TO=$(( (SECS * 5 + 1) / 2 + 5 ))
18+for T in "$@"; do
19+ [ -s "$OUT/KT-$T.txt" ] && ! grep -q baseline_failed "$OUT/KT-$T.txt" || { echo "$T: KT empty"; continue; }
20+ python3 -c "import json,sys;json.dump([l.rstrip('\n') for l in open(sys.argv[1]) if l.strip()],open(sys.argv[2],'w'))" "$OUT/KT-$T.txt" "$OUT/KT-$T.json"
21+ FAILFAST=1 python3 "$TOOLS/mutrun.py" "$OUT" "$OUT/KT-$T.json" "F-$T" "$TO" "all()$EX" --profile fast > "$OUT/F-$T.log" 2>&1
22+ awk -F'\t' '$2=="SURVIVED"{print $1}' "$OUT/res-F-$T.tsv" > "$OUT/K-$T.txt"
23+ echo "$T fast statuses: $(cut -f2 "$OUT/res-F-$T.tsv" | sort | uniq -c | tr '\n' ' ') K=$(wc -l < "$OUT/K-$T.txt")"
24+done
25+echo FAST_DONE
lanes/testcut/p2h265-tools/gate.shadded+5 -0
@@ -0,0 +1,5 @@
1+#!/usr/bin/env bash
2+export EC_REQUIRE_FIXTURES=1
3+cargo clippy --release -p ec-h265 --tests -- -D warnings 2>&1 | tail -15; echo "clippy rc=${PIPESTATUS[0]}"
4+cargo test --release -p ec-h265 2>&1 | grep -E "^test result|FAILED|failed|panicked|^error" | head -30; echo "test rc=${PIPESTATUS[0]}"
5+echo GATE_DONE
lanes/testcut/p2h265-tools/mutrun.pymodified+24 -7
@@ -49,20 +49,31 @@ def apply(orig, hunks):
4949 res.extend(orig[cur:])
5050 return res
5151
52-def run_once():
53- cmd = ["cargo", "nextest", "run", "-p", "ec-h265", "--no-fail-fast", "-E", expr]
54- if profile:
55- cmd[-2:-2] = ["--profile", profile]
52+def sh(cmd, tmo):
5653 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,
5754 start_new_session=True)
5855 try:
59- output, _ = p.communicate(timeout=timeout)
56+ output, _ = p.communicate(timeout=tmo)
6057 return p.returncode, output, False
6158 except subprocess.TimeoutExpired:
6259 os.killpg(p.pid, 9)
6360 output, _ = p.communicate()
6461 return -1, output or "", True
6562
63+BUILD_TO = int(os.environ.get("BUILD_TO", "2400"))
64+
65+def run_once():
66+ # release profile; build first (own generous timeout), then run with the measured-baseline timeout
67+ cmd = ["cargo", "nextest", "run", "--release", "-p", "ec-h265", "--no-fail-fast", "-E", expr]
68+ if os.environ.get("FAILFAST"):
69+ cmd.remove("--no-fail-fast")
70+ if profile:
71+ cmd[-2:-2] = ["--profile", profile]
72+ rc, out, to = sh([c for c in cmd if c != "--no-fail-fast"] + ["--no-run"], BUILD_TO)
73+ if to or rc != 0:
74+ return rc, out, "BUILDFAIL"
75+ return sh(cmd, timeout)
76+
6677 rows = []
6778 for name in names:
6879 m = muts.get(name)
@@ -81,13 +92,19 @@ for name in names:
8192 try:
8293 open(fname, "w").write("\n".join(new))
8394 rc, output, timed_out = run_once()
95+ timed_out = timed_out
8496 finally:
8597 open(fname, "wb").write(raw)
86- summary = re.findall(r"Summary \[[^\]]*\] (\d+) tests? run", output)
98+ summary = re.findall(r"Summary \[[^\]]*\] (\d+)(?:/\d+)? tests? run", output)
8799 ran = int(summary[-1]) if summary else 0
88- if timed_out:
100+ if timed_out == "BUILDFAIL":
101+ status = "UNVIABLE"
102+ elif timed_out:
89103 # A timeout is kill evidence only if the test run had started (build time alone is not).
90104 status = "KILLED" if re.search(r"Starting \d+ tests?", output) else "TIMEOUT_NOSTART"
105+ elif rc != 0 and re.search(r"EC_REQUIRE_FIXTURES|fixtures? (missing|not found)", output):
106+ # A fixture-missing failure is not a kill.
107+ status = "FIXTURE_FAIL"
91108 elif "could not compile" in output or "error[E" in output:
92109 status = "UNVIABLE"
93110 elif rc == 0 and ran > 0:
lanes/testcut/p2h265-tools/recheck.shadded+14 -0
@@ -0,0 +1,14 @@
1+#!/usr/bin/env bash
2+# Recheck the timeout-only rows with long timeouts. Runs from synced tree.
3+set -uo pipefail
4+export EC_REQUIRE_FIXTURES=1
5+TOOLS=$PWD/lanes/testcut/p2h265-tools
6+OUT=$(dirname "$PWD")/out
7+EXN="$(awk '{print " and not test(=" $2 ")"}' "$OUT/fast-excluded.txt" | tr -d '\n')"
8+N="crates/ec-h265/src/ctu.rs:534:29: replace + with - in CtuEncoder<'a>::save_meta"
9+F="crates/ec-h265/src/ctu.rs:429:13: replace + with - in CtuEncoder<'a>::code_quadtree"
10+python3 -c "import json,sys;json.dump([sys.argv[1]],open(sys.argv[3],'w'));json.dump([sys.argv[2]],open(sys.argv[4],'w'))" "$N" "$F" "$OUT/rc-n.json" "$OUT/rc-f.json"
11+FAILFAST=1 python3 "$TOOLS/mutrun.py" "$OUT" "$OUT/rc-n.json" rc-n-fast 1200 "all()$EXN" --profile fast
12+python3 "$TOOLS/mutrun.py" "$OUT" "$OUT/rc-f.json" rc-f-T 600 "test(/(^|::)ffmpeg_decodes_bit_exactly_at_every_shape\$/)"
13+FAILFAST=1 python3 "$TOOLS/mutrun.py" "$OUT" "$OUT/rc-f.json" rc-f-fast 1200 "all()$EXN" --profile fast
14+echo RECHECK_DONE
lanes/testcut/p2h265-tools/run1.shmodified+21 -10
@@ -1,22 +1,33 @@
11 #!/usr/bin/env bash
2-# Step 1 (T only). usage: run1.sh TEST:SECONDS ... (run from the synced tree; OUT = <lane>/out)
3-# Per candidate: 20 seeded U(T) mutants (sample2.py), each applied from its own mutants.json diff
4-# (mutrun.py) and run against T only with timeout 3x T's runtime.
5-# Writes KT-<T>.txt (killed by T) and S1-<T>.txt (survived T alone), plus res-B1-<T>.tsv.
2+# Step 1 (T only), one chain, RELEASE profile. usage: run1.sh T ... (run from the synced tree; OUT = <lane>/out)
3+# Per candidate: build, measured unmutated baseline of T (wall seconds of the run), then SAMPLE_N (default 10)
4+# seeded mutants (sample2.py) each applied in place (mutrun.py), built, and run against T only with
5+# timeout = 2.5 x measured baseline. Writes KT-<T>.txt, S1-<T>.txt, res-B1-<T>.tsv, base-<T>.secs.
66 set -uo pipefail
77 export EC_REQUIRE_FIXTURES=1
88 TOOLS=$PWD/lanes/testcut/p2h265-tools
99 OUT=$(dirname "$PWD")/out
10-mkdir -p "$OUT"
1110 SEED=2026
12-for arg in "$@"; do
13- T=${arg%%:*}; SECS=${arg##*:}; TO=$((SECS * 3))
14- python3 "$TOOLS/sample2.py" "$OUT" "$T" 20 "$SEED" || { echo "$T sample failed"; continue; }
15- echo "== $T timeout ${TO}s $(date +%T)"
16- python3 "$TOOLS/mutrun.py" "$OUT" "$OUT/s-$T.json" "B1-$T" "$TO" "test(/(^|::)$T\$/)" > "$OUT/B1-$T.log" 2>&1
11+N=${SAMPLE_N:-10}
12+for T in "$@"; do
13+ F="test(/(^|::)$T\$/)"
14+ echo "== $T build $(date +%T)"
15+ cargo nextest run --release -p ec-h265 -E "$F" --no-run > "$OUT/build-$T.log" 2>&1 || { echo "$T build failed"; continue; }
16+ S=$(date +%s)
17+ cargo nextest run --release -p ec-h265 --no-fail-fast -E "$F" > "$OUT/base-$T.log" 2>&1
18+ BRC=$?; E=$(date +%s); SECS=$((E - S))
19+ echo "$SECS" > "$OUT/base-$T.secs"
20+ if [ "$BRC" -ne 0 ] || ! grep -qE "Starting [0-9]+ tests?" "$OUT/base-$T.log"; then
21+ echo "$T baseline_failed rc=$BRC"; echo "baseline_failed" > "$OUT/KT-$T.txt"; : > "$OUT/S1-$T.txt"; continue
22+ fi
23+ TO=$(( (SECS * 5 + 1) / 2 + 5 ))
24+ echo "baseline ${SECS}s timeout ${TO}s $(date +%T)"
25+ python3 "$TOOLS/sample2.py" "$OUT" "$T" "$N" "$SEED" || { echo "$T sample failed"; continue; }
26+ python3 "$TOOLS/mutrun.py" "$OUT" "$OUT/s-$T.json" "B1-$T" "$TO" "$F" > "$OUT/B1-$T.log" 2>&1
1727 echo "exit $? $(date +%T)"
1828 awk -F'\t' '$2=="KILLED"{print $1}' "$OUT/res-B1-$T.tsv" > "$OUT/KT-$T.txt"
1929 awk -F'\t' '$2=="SURVIVED"{print $1}' "$OUT/res-B1-$T.tsv" > "$OUT/S1-$T.txt"
2030 echo "statuses: $(cut -f2 "$OUT/res-B1-$T.tsv" | sort | uniq -c | tr '\n' ' ')"
2131 echo "KT=$(wc -l < "$OUT/KT-$T.txt") S1=$(wc -l < "$OUT/S1-$T.txt")"
2232 done
33+echo CHAIN_DONE