edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
VERDICT: No commit this round. The u16 widen of PlaneBuf::data was attempted,
got substantially further than r9 (67 -> ~35 remaining cargo check errors,
decode.rs's own internal sites plus all of intra.rs fully widened and
type-correct on their own), but did not reach a compiling state inside the
turn budget. Per the charter's own rule ("a non-compiling [crate] is not [a
fine place to stop]"), the attempt was reversed with git apply -R against a
saved diff rather than committed half-wired. Working tree is clean, at
b8ad140 + the r10 charter commit c7b3fa0, cargo check -p ec-av1 --lib
clean, matching the round-start state (262/0 suite, unexercised this round
since nothing changed).
What was reached this round (and reverted)
PlaneBuf::data: Vec<u8> -> Vec<u16> (decode.rs:3428), sample_max()
made pub(crate) for cross-module reuse, then the checker-driven sweep:
PlaneBuf::edges/edges_rectreturn types ->(Option<Vec<u16>>, Option<Vec<u16>>, Option<u16>).PlaneBuf::reconstruct/reconstruct_rect: prediction buffervec![0u16; ..], both clamp-and-write sites ->.clamp(0, sample_max()) as u16.PALETTE_PREDthread-local widened toVec<u16>(itscolorssource was alreadyu16, this dropped a staleas u8truncation).- CDEF's single write-back site (
decode.rs:4687) ->sample_max()/u16. - The whole deblock
filter_edgefunction (decode.rs:5121, 4/6/8/14-tap taps, ~14 write sites) ->data: &mut [u16], every.clamp(0, 255) as u8->.clamp(0, sample_max()) as u16. - Every
PlaneBuf { data: vec![0u8; ...], ... }zero-init (key frame, inter frame, and one more decode entry point — 3 sites) ->vec![0u16; ...]. - Reference-frame ingestion (
Picture.y/u/v->PlaneBuf.data, 6 struct literals:reference.{y,u,v}and the per-slotg.{y,u,v}loop) ->.iter().map(|&s| s as u16).collect()(widening in fromPicture, which staysu8this stage). - The two
PlaneBuf -> Picturenarrowing points (bothy/u/v: y.data, ...struct literals) ->.into_iter().map(|s| s as u8).collect()(narrowing out toPicture, which staysu8this stage — this is the exact site r8's report named as still open, now closed). intra.rsfully widened end to end:Edges::build,predict,directional,dc,predict_filter_intraall take/return&[u16]/Option<u16>/&mut [u16]now, every.clamp(0, 255) as u8(5 sites, including 2 internal accumulator clamps that were previously untouched) ->.clamp(0, crate::decode::sample_max()) as u16. Its own#[cfg(test)]module (fill/checksum/the twopredict()call sites) updated in step; this file alone type-checked clean in isolation before the wider sweep continued.
That diff (500 lines) is saved at
/tmp/claude-1000/.../scratchpad/r10-attempt.diff for the next round to
replay rather than redo by hand — it is NOT applied to the tree right now.
Exact remaining error clusters (the live checklist, ~35 sites when this
round stopped, cargo check -p ec-av1 --lib against the PlaneBuf-widened
tree)
crates/ec-av1/src/restoration.rs'sapply_loop_restoration_planestill takes/returnsVec<u8>(decode.rs:5445/5457/5469, the 3 call sites that assign its result intoy.data/u.data/v.data) — untouched this round, not inspected past its signature.- The two remaining debug-dump
write_all(&y.data)blocks (decode.rs:6165-6167and12109-12111,EC_AV1_PREFILT_DUMP) and thecrop_wide/cropclosures (6174-ish and6209/12151-ish, both build a croppedVec<u8>fromplane.data) still assumeu8— these are debug/superres-crop paths, need the same.iter().map(|&s| s as u8)narrowing pattern already used at the twoPictureliterals. decode.rs:6520—reconstruct_mc's ownprediction: &[u8]param + its.clamp(0, 255) as u8write, the same pattern asreconstruct/reconstruct_rectabove it, not yet touched.decode.rs:6996/7071and8242through10202(~24 call sites,mc::predict/predict_with_filter(s)/predict_compound_intermediate/combine_compound/blend_masked_compound, plusinterintra_blend's ownpred: &mut [u8]and its internalvec![0u8; side*side]intra buffer at~7040) —mc.rsitself (907 lines,predict/predict_with_filter(s)/predict_compound_intermediate/combine_compound/blend_masked_compound, all six still&[u8]/&mut [u8]) is the one big remaining piece; the charter's own note that a prior round widenedmc.rsalone in ~10 tool calls (using the samesample_max()pattern just proven out inintra.rsthis round) makes it the right next step — do it FIRST next round since PlaneBuf is already committed by then andcargo checkwill point at exactly these call sites.crates/ec-av1/src/encode.rs:600/820/872— three call sites intointra::predict/predict_filter_intrafrom the ENCODER side, not inventoried by r8 or the charter at all (a new site class this round's attempt surfaced: the encoder sharesintra.rswith the decoder, so wideningintra.rsfans out intoencode.rstoo, still onu8sample buffers there — untouched, not even read this round; next round needs to either widenencode.rs's own picture buffers in step or box the u8<->u16 conversion at those three call sites specifically since the encoder isn't in this charter's scope).warp.rs,superres.rs— never reached (errors upstream of them all still open); charter's own inventory (1 clamp-and-cast site each) is presumably still accurate but unverified this round.
Why this round stopped short
Turn-budget math: intra.rs's full widen (13 signature/body edits across a
970-line file) and decode.rs's own ~20-site internal sweep both landed
clean and are real, reusable progress — verified by literally getting the
error count from 67 to ~35 with cargo check as the checklist, exactly as
charter directed. What remained (restoration.rs, mc.rs, the newly
discovered encode.rs fan-out, two debug-dump closures) was correctly
estimated as too large to land AND leave green before the ~turn-55 stop
point, so the attempt was reversed rather than committed non-compiling.
Recommendation for r11
- Re-apply
/tmp/claude-1000/.../scratchpad/r10-attempt.diff(git apply, not by hand) as the starting point — it is the PlaneBuf widen +intra.rswiden, both proven type-correct in isolation. - Fix
restoration.rs'sapply_loop_restoration_plane(small, self contained — likely one function). - Fix the two debug-dump narrowing closures +
reconstruct_mc's clamp (small, same pattern as everything already done). - Widen
mc.rsLAST as the charter said, following the exact pattern this round proved out inintra.rs(sample_max(), no other new machinery needed) — expect ~24 decode.rs call sites to resolve for free once its six functions take&[u16]/&mut [u16]. - New this round: budget a pass over
encode.rs's 3 call sites intointra.rs— decide whether the encoder's own picture buffers widen too (likely no, out of this charter's scope) or whether those 3 sites get a local u8<->u16 box. - Run the 262-test suite before committing (per charter); it was NOT run this round since nothing new landed to test.
Merge note
git status clean; nothing to merge. No refusal strings touched. intra.rs
and decode.rs are byte-identical to c7b3fa0 (git apply -R verified with
a clean cargo check -p ec-av1 --lib, matching the round-start baseline).