cleanup(codegen): remove dead Codegen fields region_stack + bump_ptr (+ orphaned RegionInfo)#250
Merged
Merged
Conversation
…(+ orphaned RegionInfo) Per typed-wasm proposal 0001 Appendix B "Producer-readiness checklist" follow-up. Both fields were marked `#[allow(dead_code)]` with comment "reserved for future interpreter use" — declared, initialized in `Codegen::new()`, never read or written elsewhere in the crate. Removed: - `Codegen.region_stack: Vec<RegionInfo>` field + its constructor init - `Codegen.bump_ptr: u32` field + its constructor init (adjacent dead code in the same struct, same "reserved" comment) - `RegionInfo` struct (only consumer was region_stack; orphaned after removal — its own fields were `#[allow(dead_code)]`) Retained: - `REGION_HEADER_SIZE` constant — `pub`, conceptually describes the linear-memory layout (used by comments at lines 28 + 76 + within the wasm-side memory-layout code at ~1506-1531 that manipulates the wasm-memory "bump_ptr" cell at offset 0). Removing the Rust- side dead struct field does not affect the wasm-side memory layout. The wasm-side `bump_ptr` (a value stored in wasm linear memory at offset 0) is unrelated to the removed Rust struct field of the same name; that one is real and continues to function. Verified: `cargo check -p ephapax-wasm` clean; `cargo test -p ephapax-wasm` 84/84 pass.
🔍 Hypatia Security ScanFindings: 69 issues detected
View findings[
{
"reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in abi-verify.yml",
"type": "missing_timeout_minutes",
"file": "abi-verify.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in codeql.yml",
"type": "missing_timeout_minutes",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in coq-build.yml",
"type": "missing_timeout_minutes",
"file": "coq-build.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in governance.yml",
"type": "missing_timeout_minutes",
"file": "governance.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in hypatia-scan.yml",
"type": "missing_timeout_minutes",
"file": "hypatia-scan.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in mirror.yml",
"type": "missing_timeout_minutes",
"file": "mirror.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in rust-ci.yml",
"type": "missing_timeout_minutes",
"file": "rust-ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in scorecard-enforcer.yml",
"type": "missing_timeout_minutes",
"file": "scorecard-enforcer.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in scorecard-enforcer.yml",
"type": "missing_timeout_minutes",
"file": "scorecard-enforcer.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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.
Summary
Per typed-wasm proposal 0001 Appendix B "Producer-readiness checklist"
follow-up. Both fields in `Codegen` were marked `#[allow(dead_code)]`
with the comment "reserved for future interpreter use" — declared,
initialized in `Codegen::new()`, never read or written elsewhere in
the crate.
Removed
code in the same struct, same "reserved" comment)
after removal — its own fields were already `#[allow(dead_code)]`)
Retained
linear-memory layout (used by comments at lines 28 + 76 + within the
wasm-side memory-layout code at ~1506-1531 that manipulates the
wasm-memory `bump_ptr` cell at offset 0). Removing the Rust-side
dead struct field does not affect the wasm-side memory layout.
Important disambiguation
The wasm-side `bump_ptr` (a value stored in wasm linear memory at
offset 0, real and load-bearing) is unrelated to the removed Rust
`Codegen.bump_ptr` struct field of the same name. The struct field
was a stale carry-over from an earlier design where the Codegen
tracked it Rust-side; the actual implementation tracks it inside the
emitted wasm. The naming collision is what kept the dead field
camouflaged.
Verification
Carry-forward note
This closes the dead-code item from typed-wasm proposal 0001 Appendix B.
The access-sites codegen follow-up is filed at the ephapax counterpart
to affinescript#462.
🤖 Generated with Claude Code