feat(tensor): bit-granular read cursor for byteConversionAppend + pub…#390
Conversation
…lic unpackSignExtend The append loop could start WRITING at any bit position (dstStartBit) but always started READING at bit 0 of the source byte pointer — decoding a packed mixed-width stream (DeltaSym: segments rarely start byte-aligned) was impossible. - byteConversionAppend gains a trailing srcStartBit: the input cursor is seeded the same way as the output cursor (index srcStartBit/8, phase srcStartBit%8). Reads exactly numValues*dataInBits bits, so segments may also END mid-byte. byteConversion delegates with (0, 0). - unpackSignExtend is now public (TensorConversion.h) with a srcStartBit parameter, so DeltaSym-style decoders can sign-extend a segment that starts mid-byte; internally switched from byteConversion to byteConversionAppend (clear-then-set defines all widened bits, no memset). Co-Authored-By: Claude Fable 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe tensor conversion bridge now accepts independent source and destination bit offsets. Signed unpacking exposes ChangesBit-Offset Conversion
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TensorConversion
participant unpackSignExtend
participant byteConversionAppend
TensorConversion->>unpackSignExtend: decode packed signed values
unpackSignExtend->>byteConversionAppend: read from srcStartBit
byteConversionAppend-->>unpackSignExtend: widened values
unpackSignExtend-->>TensorConversion: sign-extended int32 outputs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…lic unpackSignExtend
The append loop could start WRITING at any bit position (dstStartBit) but always started READING at bit 0 of the source byte pointer — decoding a packed mixed-width stream (DeltaSym: segments rarely start byte-aligned) was impossible.