Skip to content

fix: binop width selection to preserve byte semantics [LA-D]#373

Merged
ashpect merged 1 commit into
v1from
rs/issue_d_v1
Mar 26, 2026
Merged

fix: binop width selection to preserve byte semantics [LA-D]#373
ashpect merged 1 commit into
v1from
rs/issue_d_v1

Conversation

@rose2221
Copy link
Copy Markdown
Collaborator

Summary

  • Restricted get_optimal_binop_width to only return widths that divide 8 ({2, 4, 8}) instead of the full range [2, 8]. Non-dividing widths (e.g. 3, 5, 6, 7) cause digit decompositions that overallocate bit capacity beyond [0, 255], breaking byte semantics.
  • Added unit tests for the binop module:
    • optimal_binop_width_always_divides_8: verifies the width invariant holds for all input sizes up to 1024.
    • non_canonical_byte_rejected_by_recomposition: regression test confirming that the recomposition constraint rejects non-canonical byte values (> 255) when using w ∈ {2, 4}.

@rose2221 rose2221 changed the title feat: update optimal binop width calculation and add tests for byte s… fix: binop width selection to preserve byte semantics [LA-D] Mar 22, 2026
@ashpect ashpect merged commit 6d4709c into v1 Mar 26, 2026
1 of 3 checks passed
dcbuild3r pushed a commit that referenced this pull request May 16, 2026
fix: binop width selection to preserve byte semantics [LA-D]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants