diff --git a/CLAUDE.md b/CLAUDE.md index dcd23feb..2b2c9005 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -3553,6 +3553,11 @@ cd worker && cargo run --release -- --config test_job.json > 23-30 s there and failed 8 nightly legs (task #99, as task #95 did for > Descale). Don't raise the default in `dart_test.yaml`: it would hide real > hangs everywhere. +> **A slow encode also passes `runJob` a `timeout:` below the test's own** +> (its default is 5 min), and a smoke encode covers only the frames its +> pass needs: BM3D on the whole 79-frame fixture took up to 300+ s on the +> Macs and hit that limit 9 times in 40 nightlies; it now encodes 24 +> (task #128). > A `setUpAll` can't state one: package:test gives it 12 minutes, fixed, > which is why the nightly prefetches add-ons before the tests (task #117, > "Add-ons"). diff --git a/app/test/integration_new_passes_test.dart b/app/test/integration_new_passes_test.dart index 0010313f..da4387ba 100644 --- a/app/test/integration_new_passes_test.dart +++ b/app/test/integration_new_passes_test.dart @@ -45,6 +45,9 @@ import 'support/worker_harness.dart'; String get _outDir => '${WorkerHarness.outputDir}/new_passes'; +/// Frames the BM3D encode covers (task #128): enough for its temporal step. +const _bm3dFrames = 24; + VideoJob _baseJob( String name, { ProcessingPipeline? pipeline, @@ -223,6 +226,11 @@ void main() { }, timeout: const Timeout(Duration(minutes: 6))); test('noise reduction: BM3D runs end-to-end, chroma included', () async { + // The whole 79-frame fixture took 222-300+ s on macos-arm64 and up to + // 300+ s on the x64 Macs, and hit the harness's 300 s job limit 9 + // times in 40 nightlies (task #128). 24 frames still give V-BM3D's + // radius 1 neighbours on both sides, at ~90 s on the slowest Mac; the + // job limit stays below the test's so a hang is named and sampled. final job = _baseJob( 'nr_bm3d', pipeline: const ProcessingPipeline( @@ -233,9 +241,14 @@ void main() { bm3dChromaSigma: 2.0, ), ), - ); - final result = await WorkerHarness.runJob(job.toJson(), label: 'nr_bm3d'); + ).copyWith(startFrame: 0, endFrame: _bm3dFrames - 1); + final result = await WorkerHarness.runJob(job.toJson(), + label: 'nr_bm3d', timeout: const Duration(minutes: 5)); await _expectValidVideo(result); + // A trim that stopped applying would bring the 300 s run back quietly. + final v = await WorkerHarness.firstStream(result.outputPath!, + selector: 'v:0', entries: ['nb_read_frames'], countFrames: true); + expect(v?['nb_read_frames'], '$_bm3dFrames'); }, timeout: const Timeout(Duration(minutes: 6))); test('noise reduction: KNLMeans runs end-to-end where OpenCL works', diff --git a/docs/ENGINEERING_NOTES.md b/docs/ENGINEERING_NOTES.md index 89d7295d..de509141 100644 --- a/docs/ENGINEERING_NOTES.md +++ b/docs/ENGINEERING_NOTES.md @@ -7087,3 +7087,23 @@ What was done: 8 places on main. Out of scope: the runner's toolchains (above), python-build-standalone (pinned by URL), and akarin's vendored `libz` / `libboost_charconv` (a pinned wheel). + +### The BM3D smoke encode outgrew the harness's job limit (task #128, 2026-11-28) + +- **Symptom.** `integration_new_passes_test.dart`'s `noise reduction: BM3D + runs end-to-end, chroma included` failed with `nr_bm3d timed out after + 300s` on the macos-arm64 heavy leg of nightly 46018310484, after the encode + had finished (79/79 frames, 0.27 fps). The test allows 6 minutes, but + `WorkerHarness.runJob`'s default job limit is 5. +- **Measured** from the logs of the last 40 nightlies (165 heavy legs): the + test took 222–300+ s on macos-arm64 (mean 279 s), 102–300+ s on the x64 + Macs, at most 232 s on Linux and 190 s on Windows, and timed out 9 times, + all on Mac legs. A standing flake, not one draw. #114's bundle and + rc4's run BM3D at the same speed on an M1, so it is runner speed. +- **Fix.** The test encodes 24 frames (`endFrame: 23`), which still gives + V-BM3D's radius 1 a neighbour each side; it passes `runJob` an explicit + 5-minute limit (below the test's 6) and asserts 24 output frames, so a + trim that stopped applying would not bring the long run back quietly. + Never a retry. + +Report: [docs/reports/task-128-bm3d-heavy-test-time](reports/task-128-bm3d-heavy-test-time/index.html). diff --git a/docs/reports/README.md b/docs/reports/README.md index 839d62bb..a49e0b62 100644 --- a/docs/reports/README.md +++ b/docs/reports/README.md @@ -66,6 +66,7 @@ to it. | Date | Report | Outcome | |---|---|---| +| 2026-11-28 | [Task #128: the BM3D smoke encode that outgrew the 300 s job limit](task-128-bm3d-heavy-test-time/index.html) | Fixed in the test: across 40 nightlies the 79-frame BM3D encode took 222–300+ s on macos-arm64 and up to 300+ s on the x64 Macs, and hit `runJob`'s default 300 s limit 9 times, all on Mac legs; Linux ≤ 232 s, Windows ≤ 190 s. Runner speed, not the deps. It now encodes 24 frames (radius 1 still has neighbours both sides) under an explicit 5 min job limit and asserts the count | | 2026-11-27 | [Task #124: the DCTFilter stress test that timed out on Windows](task-124-dctfilter-stress-timeout/index.html) | Fixed in the tests: the test's vspipe was held in its exit by Defender (task #122), and tests ran vspipe with `Process.run`, with no limit, so the worker's 30 s guard never applied. The logs: after the timeout the next test ran at normal speed beside the leftover process (160 s vs 170–177 s), and a console host was left at job end. Every test that runs vspipe now goes through `runVspipe`, the worker's rule as a pinned Dart twin, with stacks before the kill; the stress tests bound (90 s) and time each graph (M1: DCTFilter 0.5–0.8 s, DFTTest 9–11 s). Not yet run on Windows with the change | | 2026-11-27 | [Task #113: Retinex r4 appends our sigma to its defaults](task-113-retinex-sigma/index.html) | Fixed in the deps scripts (next deps version): Windows shipped the r4 DLL, whose parser runs `sigma=[X]` as `[25, 80, 250, X]`; macOS/Linux built 6bfbdd42 (r4 + the fix). Shadow Detail was 9–11 levels apart at the default sigma (max 34; three frames of small_clip, luma), and the slider moved Windows' picture a seventh as far. The r4 tag built on the same machine matches the emulation exactly. Windows now builds 6bfbdd42 with Zig, marked by a no-code patch; macOS output byte-identical. macOS arm64 measured; the Windows DLL cross-compiled but run only in CI | | 2026-11-27 | [Task #126: zimg 9806db42 (graphengine 308d3735) against the pinned 67e06032](task-126-zimg-9806db42/index.html) | Clean; pinned from deps 1.18.0-rc5 (task #127). Upstream's fix for task #109 (zimg 9806db42 = our 67e06032 + graphengine 308d3735), built as R78 builds it and run over #109's 158 graphs on Linux x64/arm64 (gcc 13, clang 18) and macOS arm64: no overrun, guard-page abort or new ASan report (the 36 error-diffusion graphs included), and every picture byte-identical to the pin's (FNV-1a of each destination, SIMD and C kernels). Every graph's tmp buffer is smaller (median 0.89x on x64, 0.86x on arm64). Linux arm64 gcc 13 ASan flags the same 32 4:2:0 graphs at both commits and clang 18 none (task #115). Bundle A/B (task #127): the Linux build links the new zimg; task #109's vs_confirm.sh finds no abort or invalid write at either commit; ci-test and nightly pass on linux-x64 v3/v2 except 3 field-order tests that fail the same way on rc4 | diff --git a/docs/reports/task-128-bm3d-heavy-test-time/data/bm3d_times.txt b/docs/reports/task-128-bm3d-heavy-test-time/data/bm3d_times.txt new file mode 100644 index 00000000..f00bfb35 --- /dev/null +++ b/docs/reports/task-128-bm3d-heavy-test-time/data/bm3d_times.txt @@ -0,0 +1,165 @@ +2026-11-28 46097637546 windows (windows-x64, heavy) 124 ok +2026-11-28 46097637546 linux (linux-x64-v2, heavy) 118 ok +2026-11-28 46097637546 macos (macos-arm64, heavy) 296 ok +2026-11-28 46097637546 macos (macos-x64, heavy) 193 ok +2026-11-28 46097637546 windows (windows-x64-v2, heavy) 164 ok +2026-11-28 46097637546 macos (macos-x64-v2, heavy) 122 ok +2026-11-28 46097637546 linux (linux-x64, heavy) 141 ok +2026-11-27 46038708313 linux (linux-x64-v2, heavy) 120 ok +2026-11-27 46038708313 linux (linux-x64, heavy) 118 ok +2026-11-27 46038708313 windows (windows-x64, heavy) 109 ok +2026-11-27 46038708313 windows (windows-x64-v2, heavy) 104 ok +2026-11-27 46038708313 macos (macos-x64, heavy) 193 ok +2026-11-27 46038708313 macos (macos-x64-v2, heavy) 214 ok +2026-11-27 46038708313 macos (macos-arm64, heavy) 251 ok +2026-11-27 46018310484 linux (linux-x64, heavy) 167 ok +2026-11-27 46018310484 linux (linux-x64-v2, heavy) 117 ok +2026-11-27 46018310484 macos (macos-arm64, heavy) 313 FAIL +2026-11-27 46018310484 windows (windows-x64-v2, heavy) 108 ok +2026-11-27 46018310484 windows (windows-x64, heavy) 107 ok +2026-11-27 46018310484 macos (macos-x64-v2, heavy) 123 ok +2026-11-27 46018310484 macos (macos-x64, heavy) 184 ok +2026-11-27 45997028089 windows (windows-x64, heavy) 91 ok +2026-11-27 45997028089 macos (macos-arm64, heavy) - +2026-11-27 45997028089 macos (macos-x64, heavy) - +2026-11-27 45997028089 macos (macos-x64-v2, heavy) 282 ok +2026-11-27 45997028089 linux (linux-x64-v2, heavy) - +2026-11-27 45997028089 linux (linux-x64, heavy) 119 ok +2026-11-27 45997028089 windows (windows-x64-v2, heavy) 109 ok +2026-11-27 45996823325 linux (linux-x64-v2, heavy) 174 ok +2026-11-27 45996823325 macos (macos-arm64, heavy) - +2026-11-27 45996823325 windows (windows-x64-v2, heavy) - +2026-11-27 45996823325 macos (macos-x64, heavy) - +2026-11-27 45996823325 linux (linux-x64, heavy) 80 ok +2026-11-27 45996823325 macos (macos-x64-v2, heavy) - +2026-11-27 45996823325 windows (windows-x64, heavy) - +2026-11-27 45996291642 linux (linux-x64-v2, heavy) 173 ok +2026-11-27 45996291642 macos (macos-x64, heavy) 253 ok +2026-11-27 45996291642 macos (macos-x64-v2, heavy) 152 ok +2026-11-27 45996291642 windows (windows-x64, heavy) 150 ok +2026-11-27 45996291642 linux (linux-x64, heavy) 170 ok +2026-11-27 45996291642 windows (windows-x64-v2, heavy) 110 ok +2026-11-27 45996291642 macos (macos-arm64, heavy) 320 FAIL +2026-11-26 45913434555 windows (windows-x64-v2, heavy) 149 ok +2026-11-26 45913434555 windows (windows-x64, heavy) 147 ok +2026-11-26 45913434555 macos (macos-arm64, heavy) 287 ok +2026-11-26 45913434555 macos (macos-x64, heavy) 117 ok +2026-11-26 45913434555 macos (macos-x64-v2, heavy) 168 ok +2026-11-26 45913434555 linux (linux-x64, heavy) 115 ok +2026-11-26 45913434555 linux (linux-x64-v2, heavy) 144 ok +2026-11-26 45913182922 windows (windows-x64-v2, heavy) - +2026-11-26 45867504513 macos (macos-x64, heavy) 233 ok +2026-11-26 45867504513 macos (macos-arm64, heavy) 247 ok +2026-11-26 45867504513 windows (windows-x64, heavy) 190 ok +2026-11-26 45867504513 windows (windows-x64-v2, heavy) 152 ok +2026-11-26 45867504513 macos (macos-x64-v2, heavy) 138 ok +2026-11-26 45867504513 linux (linux-x64, heavy) 114 ok +2026-11-26 45867504513 linux (linux-x64-v2, heavy) 117 ok +2026-11-26 45796959369 macos (macos-arm64, heavy) 228 ok +2026-11-26 45796959369 windows (windows-x64, heavy) 79 ok +2026-11-26 45796959369 linux (linux-x64, heavy) 146 ok +2026-11-26 45796959369 macos (macos-x64, heavy) 234 ok +2026-11-26 45796959369 windows (windows-x64-v2, heavy) 135 ok +2026-11-26 45796959369 macos (macos-x64-v2, heavy) 175 ok +2026-11-26 45796959369 linux (linux-x64-v2, heavy) 170 ok +2026-11-25 45667413686 windows (windows-x64-v2, heavy) 75 ok +2026-11-25 45667413686 linux (linux-x64-v2, heavy) 132 ok +2026-11-25 45667413686 windows (windows-x64, heavy) 158 ok +2026-11-25 45667413686 linux (linux-x64, heavy) 205 ok +2026-11-25 45667413686 macos (macos-x64-v2, heavy) 243 ok +2026-11-25 45667413686 macos (macos-x64, heavy) 216 ok +2026-11-24 45459637742 macos (macos-x64-v2, heavy) 155 ok +2026-11-24 45459637742 linux (linux-x64, heavy) 167 ok +2026-11-24 45459637742 linux (linux-x64-v2, heavy) 173 ok +2026-11-24 45459637742 windows (windows-x64-v2, heavy) 128 ok +2026-11-24 45459637742 windows (windows-x64, heavy) 131 ok +2026-11-24 45459637742 macos (macos-x64, heavy) 209 ok +2026-11-24 45459637742 macos (macos-arm64, heavy) 280 ok +2026-11-23 45242697745 windows (windows-x64-v2, heavy) 77 ok +2026-11-23 45242697745 macos (macos-arm64, heavy) 282 ok +2026-11-23 45242697745 windows (windows-x64, heavy) 108 ok +2026-11-23 45242697745 linux (linux-x64, heavy) 169 ok +2026-11-23 45242697745 macos (macos-x64-v2, heavy) 158 ok +2026-11-23 45242697745 linux (linux-x64-v2, heavy) 168 ok +2026-11-22 45035605064 windows (windows-x64-v2, heavy) 137 ok +2026-11-22 45035605064 linux (linux-x64, heavy) 171 ok +2026-11-22 45035605064 windows (windows-x64, heavy) 137 ok +2026-11-22 45035605064 macos (macos-arm64, heavy) 249 ok +2026-11-22 45035605064 macos (macos-x64-v2, heavy) 268 ok +2026-11-22 45035605064 macos (macos-x64, heavy) 224 ok +2026-11-22 45035605064 linux (linux-x64-v2, heavy) 170 ok +2026-11-22 45001595186 macos (macos-x64-v2, heavy) 264 ok +2026-11-22 45001595186 linux (linux-x64, heavy) 169 ok +2026-11-22 45001595186 macos (macos-arm64, heavy) 300 FAIL +2026-11-22 45001595186 windows (windows-x64, heavy) 127 ok +2026-11-22 45001595186 linux (linux-x64-v2, heavy) 170 ok +2026-11-22 45001595186 macos (macos-x64, heavy) 183 ok +2026-11-22 45001595186 windows (windows-x64-v2, heavy) 138 ok +2026-11-22 44998535692 macos (macos-x64-v2, heavy) 260 ok +2026-11-22 44998535692 macos (macos-arm64, heavy) 261 ok +2026-11-22 44998535692 macos (macos-x64, heavy) 130 ok +2026-11-22 44983943673 macos (macos-x64-v2, heavy) 163 ok +2026-11-22 44983943673 macos (macos-x64, heavy) 175 ok +2026-11-22 44983943673 windows (windows-x64, heavy) 106 ok +2026-11-22 44983943673 windows (windows-x64-v2, heavy) 121 ok +2026-11-22 44983943673 linux (linux-x64, heavy) 169 ok +2026-11-22 44983943673 linux (linux-x64-v2, heavy) 232 ok +2026-11-22 44983943673 macos (macos-arm64, heavy) 222 ok +2026-11-21 44940674293 linux (linux-x64, heavy) 6 FAIL +2026-11-21 44940674293 windows (windows-x64-v2, heavy) 156 ok +2026-11-21 44940674293 windows (windows-x64, heavy) - +2026-11-21 44940674293 macos (macos-x64-v2, heavy) 102 ok +2026-11-21 44940674293 macos (macos-arm64, heavy) - +2026-11-21 44940674293 macos (macos-x64, heavy) 174 ok +2026-11-21 44940674293 linux (linux-x64-v2, heavy) 13 FAIL +2026-11-21 44916724870 macos (macos-arm64, heavy) 287 ok +2026-11-21 44916724870 windows (windows-x64, heavy) 76 ok +2026-11-21 44916724870 linux (linux-x64-v2, heavy) 169 ok +2026-11-21 44916724870 windows (windows-x64-v2, heavy) 178 ok +2026-11-21 44916724870 linux (linux-x64, heavy) 112 ok +2026-11-21 44916724870 macos (macos-x64, heavy) 105 ok +2026-11-21 44914360715 macos (macos-x64, heavy) 168 ok +2026-11-21 44914360715 macos (macos-arm64, heavy) 300 FAIL +2026-11-21 44914360715 macos (macos-x64-v2, heavy) 175 ok +2026-11-21 44869849455 macos (macos-arm64, heavy) 288 ok +2026-11-21 44869849455 macos (macos-x64-v2, heavy) 143 ok +2026-11-21 44869849455 macos (macos-x64, heavy) 118 ok +2026-11-20 44767156916 windows (windows-x64, heavy) 81 ok +2026-11-20 44767156916 linux (linux-x64, heavy) 170 ok +2026-11-20 44767156916 linux (linux-x64-v2, heavy) 170 ok +2026-11-20 44767156916 macos (macos-x64, heavy) 295 ok +2026-11-20 44767156916 macos (macos-x64-v2, heavy) 175 ok +2026-11-20 44767156916 windows (windows-x64-v2, heavy) 103 ok +2026-11-20 44767156916 macos (macos-arm64, heavy) 300 ok +2026-11-20 44737084373 linux (linux-x64-v2, heavy) 170 ok +2026-11-20 44737084373 linux (linux-x64, heavy) 167 ok +2026-11-19 44562921675 windows (windows-x64, heavy) 166 ok +2026-11-19 44562921675 linux (linux-x64-v2, heavy) 192 ok +2026-11-19 44562921675 windows (windows-x64-v2, heavy) 147 ok +2026-11-19 44562921675 linux (linux-x64, heavy) 188 ok +2026-11-19 44562921675 macos (macos-x64-v2, heavy) 197 ok +2026-11-19 44562921675 macos (macos-x64, heavy) 300 FAIL +2026-11-19 44515333102 macos (macos-x64, heavy) 207 ok +2026-11-19 44515333102 macos (macos-x64-v2, heavy) 136 ok +2026-11-19 44515333102 macos (macos-arm64, heavy) 300 FAIL +2026-11-18 44342418084 linux (linux-x64, heavy) 194 ok +2026-11-18 44342418084 windows (windows-x64-v2, heavy) 164 ok +2026-11-18 44342418084 macos (macos-x64, heavy) 300 FAIL +2026-11-18 44342418084 macos (macos-arm64, heavy) 297 ok +2026-11-18 44342418084 linux (linux-x64-v2, heavy) 143 ok +2026-11-18 44342418084 macos (macos-x64-v2, heavy) 239 ok +2026-11-18 44342418084 windows (windows-x64, heavy) 146 ok +2026-11-17 44127090331 linux (linux-x64-v2, heavy) 137 ok +2026-11-17 44127090331 windows (windows-x64-v2, heavy) 160 ok +2026-11-17 44127090331 windows (windows-x64, heavy) 81 ok +2026-11-17 44127090331 macos (macos-x64-v2, heavy) 300 FAIL +2026-11-17 44127090331 linux (linux-x64, heavy) 190 ok +2026-11-17 44127090331 macos (macos-x64, heavy) 208 ok +2026-11-17 44127090331 macos (macos-arm64, heavy) 256 ok +2026-11-17 44089342398 windows (windows-x64, heavy) 150 ok +2026-11-17 44089342398 linux (linux-x64-v2, heavy) 187 ok +2026-11-17 44089342398 windows (windows-x64-v2, heavy) 155 ok +2026-11-17 44089342398 macos (macos-arm64, heavy) 300 ok +2026-11-17 44089342398 macos (macos-x64-v2, heavy) 300 FAIL +2026-11-17 44089342398 linux (linux-x64, heavy) 140 ok +2026-11-17 44089342398 macos (macos-x64, heavy) 204 ok diff --git a/docs/reports/task-128-bm3d-heavy-test-time/index.html b/docs/reports/task-128-bm3d-heavy-test-time/index.html new file mode 100644 index 00000000..cb98100e --- /dev/null +++ b/docs/reports/task-128-bm3d-heavy-test-time/index.html @@ -0,0 +1,242 @@ + + +
+ + +WorkerHarness.runJob without a timeout:, so the harness's default job limit, 5 minutes, applied. The encode was the whole fixture, interlaced_test.avi (720x576, 79 frames), through V-BM3D at radius 1 with chroma: on macos-arm64 it took 222–300+ s, and the job limit killed it on 5 of 21 legs; on the x64 Macs 4 of 47.startFrame: 0, so no seek is added). V-BM3D at radius 1 still has a neighbour each side, and both steps, every plane and the 16-bit round trip still run. runJob gets timeout: 5 min, below the test's 6, so a real hang is still named and sampled by the harness (task #99). The test asserts the output has 24 frames, so a trim that stopped applying could not bring the long run back unnoticed. No retry.Tests in one file run one after another, so the BM3D test's time is its result line's timestamp minus the previous test's (TTempSmooth). Limits of the metric: it includes a few seconds of ffprobe and test overhead, and a timeout row is a floor (~300 s, or up to 320 s with the hang sampling), not the encode's real time. Two Linux rows where the whole file failed in setUpAll (6 s and 13 s) are left out; they are not BM3D.
| Bundle | Legs | Min (s) | Mean (s) | Max (s) | Timeouts |
|---|---|---|---|---|---|
| macos-arm64 | 21 | 222 | 279 | 320* | 5 |
| macos-x64 | 23 | 105 | 201 | 300* | 2 |
| macos-x64-v2 | 24 | 102 | 194 | 300* | 2 |
| linux-x64 | 23 | 80 | 154 | 205 | 0 |
| linux-x64-v2 | 22 | 117 | 159 | 232 | 0 |
| windows-x64 | 20 | 76 | 123 | 190 | 0 |
| windows-x64-v2 | 21 | 75 | 132 | 178 | 0 |
Apple M1, deps 1.18.0-rc5, debug worker: the test passed, 24 frames out, in 95 s. That time is not representative: the machine's load average was 135 on 8 cores during the run (another job's VapourSynth). It shows the trim, the count and the job limit work, not the speed.
+ +scripts/bm3d_times.py then; with the trim, the delta it prints is the 24-frame test's time.python3 scripts/bm3d_times.py --runs 40 > data/bm3d_times.txt with an authenticated gh; job logs are cached in $BM3D_LOG_DIR (a temporary directory otherwise). Newer runs push older ones out of the 40, so the rows will differ.