Skip to content

Inconsistent Bit Packing Order #56

@heswithme

Description

@heswithme

Issue

Packing order inconsistency between pack_2 and pack_3 functions.

Current Implementation

pack_3: return (x[0] << 128) | (x[1] << 64) | x[2]

  • First element (x[0]) → high bits (128-191)
  • Last element (x[2]) → low bits (0-63)

pack_2: return p1 | (p2 << 128)

  • First parameter (p1) → low bits (0-127)
  • Second parameter (p2) → high bits (128-255)

Problem

The ordering is reversed between functions:

  • pack_3: first element → most significant bits
  • pack_2: first element → least significant bits

Recommendation

Standardize packing order. Either:

  1. Change pack_2: return (p1 << 128) | p2
  2. Or change pack_3: return x[0] | (x[1] << 64) | (x[2] << 128)

Option 1 preferred (first param in most significant bits).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions