Skip to content

cleanup(codegen): remove dead Codegen fields region_stack + bump_ptr (+ orphaned RegionInfo)#250

Merged
hyperpolymath merged 1 commit into
mainfrom
cleanup-codegen-dead-fields
May 30, 2026
Merged

cleanup(codegen): remove dead Codegen fields region_stack + bump_ptr (+ orphaned RegionInfo)#250
hyperpolymath merged 1 commit into
mainfrom
cleanup-codegen-dead-fields

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

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

  • `Codegen.region_stack: Vec` 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 already `#[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.

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

  • `cargo check -p ephapax-wasm` — clean, no warnings
  • `cargo test -p ephapax-wasm` — 84/84 pass

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

…(+ 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.
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 30, 2026 17:13
@hyperpolymath hyperpolymath merged commit f176f2e into main May 30, 2026
6 of 15 checks passed
@hyperpolymath hyperpolymath deleted the cleanup-codegen-dead-fields branch May 30, 2026 17:19
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 69 issues detected

Severity Count
🔴 Critical 7
🟠 High 16
🟡 Medium 46

⚠️ Action Required: Critical security issues found!

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

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