Repository navigation
One format contract per limited plugin: run_within(), limits probed from the bundle (task #48) - #209
Merged
StuartCameronCode merged 2 commits intoNov 16, 2026
Conversation
…, limits probed from the bundle (task #48) - worker/templates/plugin_formats.py: a Contract per depth-limited plugin (DeScratch, DeDot, Bifrost, LUTDeCrawl, LUTDeRainbow) and run_within(), which converts field-aware and adds only the plugin's change. Replaces the five hand-written guards and _low_depth_change. - 4:1:1 converted once at the top of the script; the per-pass 4:1:1 guards (Frame Rate, VFR placement, Cnr4, RemoveDirt) removed. - Scripts/probe-plugin-formats.py measures every pass-level plugin call at every reachable format and size; Tests/TestResources/plugin_format_table.json is the committed result. plugin_format_contracts_test (push gate: quick probe, contracts vs table, run_within on real low bits) and plugin_format_probe_test (heavy: full probe). test_251 keeps contracted plugins inside run_within. - Refusals no pass handles yet (720x486 4:2:0, MCTD width 2 mod 4) listed in plugin_formats.KNOWN (tasks #57, #56). - Report: docs/reports/task-48-plugin-format-contracts (output identical before/after except RemoveDirt, nondeterministic on both sides). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StuartCameronCode
force-pushed
the
stuart/48-one-format-contract-helper-for-plugin-gu
branch
from
November 16, 2026 07:24
95e9d99 to
4a8a5ef
Compare
…S x64 bundles (task #48) Found by the PR's first CI run: their vivtc builds accept deeper input, the macOS arm64 and Windows ones refuse it. Recorded as per-platform cells in the table; the template feeds VFM an 8-bit copy either way. 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.
Task #42's plan, R2b. Every 8-bit-only or depth-capped block in the script template had its own hand-written guard (convert down, run, convert back), and they kept going wrong the same ways: the whole low-depth result up-converted, quantising every sample (#34, #37); field-flagged 4:2:0 (#29); depth and size limits found by a user's job (#23, #31, #35).
What changes
worker/templates/plugin_formats.py: aContractper depth-limited plugin (DeScratch, DeDot, Bifrost: 8-bit; havsfunc LUTDeCrawl, LUTDeRainbow: 8–10 bit) andrun_within(clip, key, fn, label=…)._FieldBased, and applies only the plugin's change at full depth:src + back(fn(work)) - back(work).fnthat changes the frame count, size or format, and refuses a frame below a contract's minimum size with a readable message._low_depth_change.Scripts/probe-plugin-formats.pyruns all 69 pass-level plugin calls with the template's arguments. It covers {4:2:0, 4:2:2, 4:4:4} × {8, 10, 12, 16} bits × {progressive, BFF, TFF}, plus a frame-size axis up to 1080 lines and documentation rows for 4:1:1 and 9/14-bit. The result is committed asTests/TestResources/plugin_format_table.json.test_251(Rust): a contracted plugin called outsiderun_withinfails the test, naming the line.plugin_format_contracts_test.dart(push gate) checks four things:HANDLEDor filed inKNOWNrun_withinkeeps unchanged samples bit-exact on real low bitsplugin_format_probe_test.dart(heavy, nightly): the full probe.plugin_formats.KNOWN:docs/reports/task-48-plugin-format-contracts/.Testing
cargo test --test filter_integration_test: 233 passed.flutter test test/plugin_format_contracts_test.dart: 4 passed. The quick probe took about 3.5 minutes on an M1 Pro under load.integration_filter_parameters_testandtemplate_call_arguments_testpass.Risks
platformsin the table. macOS x64 is the most likely, since it has no akarin and an older MVTools.🤖 Generated with Claude Code