Archived
The engine never hands a kernel the issued value of a ranged parameter: the oracle binds it to the matched band's bound, and ref_common.h's band_rows spells the rule out -- the parameter stays a ceiling where one is stated -- which is why every existing kernel derives its counts from its operands. vtile_plan/crop/join were the first to read M as the row count of the call, so the first real tiled encode refused on device: a 512 keyframe's 3 x 3 plan, issued under the band bound 33, tripped the wrapper's rows-of-y < M clause, which answered RAD_E_STRIDE -- and the strerror insisted, wrongly, that a non-contiguous operand was the problem. Crop and join carried the same latent bug: crop would have launched 33 blocks over a ~590k-row cut, and both would have refused every canvas under their bands' real bounds. All three tiers now count from the operands and treat the passed M as the ceiling it is -- y longer than the ceiling is refused, equality never demanded. The reference and host tiers take the count from geom through band_rows; the device wrappers take it from y's rows and pass that count in the kernel's M slot, which the kernels' own operand-row guards make safe. OPS.md says the rule once at the head of the tiled encoder section: an M written in a shape is an operand's row count, the ranged M argument a ceiling only. The host gates missed the bug precisely because they drove an exact M. ref_test's three vtile cases now pass the band's bound -- 33, 33 * 256 * 256, 320 * 320 -- and demand the same exact output, plus short-operand cases that must refuse E_SHAPE under the over-declared ceiling; r4d_selftest drives the same bounds on device. Verified: ref_test 264 cases, device vtile plan 4 / crop 8 / join 5 / gather 2 / stitch 8 all exact, full ctest 123/123; and the FL2VA render that used to die in tiled encode now runs its 25 steps with both keyframes visible in the decoded clip. Co-Authored-By: Claude <noreply@anthropic.com>