Skip to content

fix: preserve bitfield width during integer promotion - #299

Merged
swananan merged 1 commit into
mainfrom
fix/bitfield-integer-promotion
Sep 6, 2026
Merged

fix: preserve bitfield width during integer promotion#299
swananan merged 1 commit into
mainfrom
fix/bitfield-integer-promotion

Conversation

@swananan

@swananan swananan commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Unsigned 25–31-bit fields lost their declared width before integer promotion and were treated as unsigned 32-bit values. Comparing them with a DWARF int valued -1, or applying bitwise NOT, division, and remainder, could disagree with the native C program.

Retain the bitfield value width until promotion. Fields whose values fit in int promote to signed 32-bit integers; full-width unsigned fields retain unsigned semantics. The change is rebased onto current main and contains one commit touching three files.

Validation:

  • Unit coverage for signed and unsigned widths 1, 24, 25, 31, and 32, including repeated promotion.
  • Two e2e tests compare tracing results with native C results for 24/25/31/32-bit fields across ordered comparison, bitwise NOT, division, and remainder. Both fail with the old promotion implementation and pass after rebuilding the fix.
  • cargo fmt --all and full workspace Clippy with CI warning settings passed.
  • All 955 non-e2e unit, integration, and documentation tests passed locally after refreshing workspace build inputs. Their test-name list exactly matches the successful GitHub Test Suite run.
  • Full standard e2e passed: 347 tests, including both new regressions, 49 Rust script tests, and all 18 scalar-type tests.
  • All 10 GitHub checks passed on 543e64d, including Standard E2E (347 tests), three full container topologies, host-PID smoke, and the DWARF performance check. The Standard E2E log confirms both new regressions ran and the Rust globals fixture was rebuilt with Rust 1.98.
  • Local container-topology runs were omitted because this change does not touch container behavior; those topologies passed in GitHub CI.

@swananan
swananan marked this pull request as ready for review September 6, 2026 04:59
@swananan
swananan force-pushed the fix/bind-globals-before-projection branch from 28e9c89 to da7727f Compare September 6, 2026 07:46
Base automatically changed from fix/bind-globals-before-projection to main September 6, 2026 09:12
@swananan
swananan force-pushed the fix/bitfield-integer-promotion branch from 957f16e to 543e64d Compare September 6, 2026 09:32
@swananan
swananan merged commit f28b207 into main Sep 6, 2026
10 checks passed
@swananan
swananan deleted the fix/bitfield-integer-promotion branch September 6, 2026 11:23
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.

1 participant