Repository navigation
fix(runtime): preserve stored partial bitstrings - #44
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Stored partial-byte bitstrings must remain intact after the writing process exits or collects garbage.
What changed
Before and after
Before: The lifetime regression failed in all three native runs because stored bitstrings referenced the writer’s freed memory.
After: Both regressions pass ten native and ten BEAM runs each, preserving the 68-bit and 1602-bit values.
This runtime fix has no graphical view; native API transcripts demonstrate the behavior.
Checked
Live validation: Demonstrated for this version. 6 of 6 scenarios driven live in the product.
How it was checked
cargo build --release --locked -p nera-runtime; cargo build --release --locked -p nera
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked --no-fail-fast
python3 scripts/test-allocator-config.py; python3 scripts/test-stacktrace-order.py, using the matching compiler
nera test -j 1 --timeout 30
Both new fixtures and both focused unit tests passed ten consecutive native runs each; both fixtures also passed ten unchanged OTP 29 runs.
The lifetime fixture also passed with NERA_SCHEDULERS=1.
Direct native storage/key operations printed and asserted all required results; local execution covers macOS arm64.
Risk
Risk above low: Blast radius, medium — ETS and persistent_term share the changed copier and in-memory key serializer.
Full risk assessment
Pipeline
Updates from git push no-mistakes
Infinitary checked this version: an independent review that also judged the documents, and live validation the review accepted.