Repository navigation
Format sweep findings: width 2 mod 4, field order after Rotate/Flip, source depth, Bifrost, CLAHE, MVTools two-row crash (task #56) - #214
Open
StuartCameronCode wants to merge 4 commits into
Conversation
…, source depth under "original", preview chroma (task #56) - F3: a quarter turn makes a still-interlaced picture progressive and a vertical mirror (or half turn) swaps its field order. One decision, ScriptGenerator::field_order_at_framing (GeometryParameters:: field_order_after), stamped on the clip before the geometry pass's format restore and read by output_field_order, the borders' field alignment and the crop/resize steps. test_221 lists the new SetFieldBased site; test_253. - F5: a still-interlaced 4:2:0 picture is resized to a height that is a multiple of 4 (framing_steps, shared with the crop detector); CropResizeParameters::output_size_stepped mirrors it. test_254. - F4: Color Format "original" restores the source's depth (dithered) after the passes, so Deband's output_depth is the working depth of the passes after it, not the file's. Schema label "Working Depth". test_255. - F8: the preview's YUV->RGB conversion interpolates chroma at every depth (accurate_rnd+full_chroma_int). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, CLAHE at 8-bit, readable preview crashes (task #56) - F9: MVTools' Compensate/Degrain/BlockFPS pick the overlap window with (by + nBlkY - 3) / (nBlkY - 2): a picture two block rows tall is SIGFPE on x86 and up to 127 levels silently wrong on arm64; one row or column is wrong everywhere. Every MVTools overlap caller (QTGMC, MCTD, SMDegrain, MCDegrainSharp, SpotLess, mClean, TemporalDegrain2) runs through plugin_formats.mvtools_blocks, which pads a picture under 64x96 and crops back (no node at real sizes). test_256. - F9b: the preview reports a vspipe failure with the encode's vspipe_failure_message, so a native crash says so instead of quoting the first plugin warning. - F1/F2/F6: task #57's pad_around (verbatim) and Contract steps. MCTD and QTGMC with SrchClipPP 1 pad a 4:2:x width 2 mod 4; QTGMC's other presets keep their width (padding moved their pictures inside the frame). Bifrost pads to its 4x8 blocks, whose leftover chroma v3.0 never initialises (720x486 4:2:2 differed run to run). test_257; probe table re-measured through run_within (havsfunc.QTGMC[SrchClipPP=1] added). - F7: Local Contrast's CLAHE decides on an 8-bit copy at every depth and only its change is applied (plugin_formats.change_at): parity with 8-bit 3-22 -> ~1 level at SD. - pipeline_executor: preview_scale_filter no longer splits field_order_note's doc comment. - The sweep's knownFailures are empty; report docs/reports/task-56-format-sweep-findings, CLAUDE.md, ENGINEERING_NOTES. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t_size (task #56 review) The script pads to _height(target_h); output_size_stepped used the unstepped target, so a still-interlaced 4:2:0 job padded to 486 predicted 486 where the script delivers 484. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The padded cells and the SrchClipPP=1 QTGMC call took the quick probe from 550 s to ~800 s on the push gate's runners; macOS x64 passed 15 min. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes every row the generated format sweep (task #47, #212) listed under task #56 in
knownFailures. The list is now empty, so the sweep fails if any of these breaks again.Findings and fixes
run_withinwith awidth_step=CHROMAcontract. The frame is padded to whole chroma columns and cropped back.havsfunc.QTGMC[SrchClipPP=1]. The other presets keep their output unchanged. Padding them would move columns well inside the frame; the edge cost is measured in the report._FieldBased, so a turned 4:2:2 picture was resampled per "field" (its columns)ScriptGenerator::field_order_at_framingandGeometryParameters::field_order_after: a quarter turn makes the picture progressive, and a vertical flip or half turn swaps TFF and BFF. The geometry block stamps the new order. The border alignment, the crop detector, the resize step andoutput_field_orderall read it.{{#DEPTH_RESTORE}}dithers back to the source's depth after the passes. Only the depth is restored, never the colour family, and it runs before the borders.framing_steps: the resize height is a multiple of 4 there, in the script's_height()and in Rust'soutput_size_stepped.width_step=4,height_step=8. Padded, the output is identical across runs at every size tested. Task #60 (Bifrost v4.0) can drop this.plugin_formats.change_at). Genuine 10–16-bit content now lands about 1 level from the 8-bit result.accurate_rnd+full_chroma_intat every depth.(by + nBlkY - 3) / (nBlkY - 2)) when a picture is two block rows tall. That is SIGFPE on x86 and up to 106 levels off, silently, on arm64. Every MVTools caller with an overlap now goes through_pf.mvtools_blocks, which pads a picture smaller than 64x96 and crops back. No real source is that small, so real jobs get no extra node. test_256 lints that every caller is wrapped.vspipe_failure_message, so a native crash is reported as one, with its signal or Windows status.The frame-size steps use task #57's
pad_around/ Contract helper, copied byte for byte from its commit so the two branches carry the same text. The probe (Scripts/probe-plugin-formats.py) andplugin_format_table.jsonare re-run.The evidence is in
docs/reports/task-56-format-sweep-findings/(index.html, scripts, data), with a dated ENGINEERING_NOTES entry. CLAUDE.md is updated: field order after Rotate / Flip, depth restore, CLAHE, contract steps, the MVTools rule, and SIGFPE /0xC0000094in Debugging Tips.Review fix:
output_size_steppednow steps Pad to Fill's box height as the script does (486 becomes 484 when the step is 4). Before, it disagreed with the script, which affected the BT.709 Auto decision and the encoder's colour tags.Testing
cargo test: 1475 passed, 0 failed. New tests are test_253–256 plus units forfield_order_after,output_size_stepped, the preview scale filter and the crash-after-warnings message.flutter test --exclude-tags heavy,gpu: 1771 passed (run before the one-line review fix).format_sweep_cases_test,plugin_format_contracts_test(including the quick probe against the table andpad_aroundon real frames) andtemplate_call_arguments_testall passed.Coordination
Task #57 (720x486, height ≡ 2 mod 4) shares
plugin_formats.py. Since the commit this branch copied, it has added afield_based_onlycontract field,read_paddedand a 96x66 sweep size. Whichever of the two merges second must merge the Contract fields and drop #57's two task-56knownFailuresentries (Bifrost 96x66, padToAspect 96x66 TFF); this branch's Bifrost step and F5 height step should cover them.🤖 Generated with Claude Code