Skip to content

fix(codegen): split gc_map tests to a sibling file for the 2000-line cap - #8957

Merged
proggeramlug merged 1 commit into
mainfrom
fix/gc-map-split
Aug 28, 2026
Merged

fix(codegen): split gc_map tests to a sibling file for the 2000-line cap#8957
proggeramlug merged 1 commit into
mainfrom
fix/gc-map-split

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

check_file_size has been red on main since #8948 merged: it takes gc_map.rs to 2047 lines, over the cap.

I prepared this split while reviewing #8948 but pushed it to the wrong remote — #8948 is same-repo (headRepo=PerryTS) and I pushed to a contributor fork the PR does not track, so the unfixed head is what merged. The push succeeded silently, which is why I did not catch it until the next PR's gate run flagged the file.

The fix itself is unchanged: the cfg(test) module moves to gc_map_tests.rs verbatim via the #[path] pattern the tree already uses (1332 + 712 lines).

Validation: codegen 1337/0, cargo fmt clean, scripts/run_lint_gates.sh 57 of 58 including the compile tier — the exception is the pre-existing \${{ }} substitution artifact (#8929).

Summary by CodeRabbit

  • Tests
    • Reorganized GC map rewriting tests into a dedicated test module.
    • Preserved coverage for Mach-O, ELF, and COFF formats, address widths, symbol attributes, derived slots, and round-trip validation.
    • No user-facing behavior or production functionality changed.

#8948 took gc_map.rs to 2047 lines and `check_file_size` has been red on
main since it merged. I had prepared this split during that PR's review but
pushed it to the wrong remote — #8948 is same-repo, and the push went to a
fork the PR does not track — so the unfixed head is what merged.

Moved the cfg(test) module out verbatim via the #[path] pattern the tree
already uses (1332 + 712 lines).
@proggeramlug
proggeramlug merged commit b6788ba into main Aug 28, 2026
19 of 20 checks passed
@proggeramlug
proggeramlug deleted the fix/gc-map-split branch August 28, 2026 12:48
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b84fe49b-44ca-450e-b949-96faa9ccf4bb

📥 Commits

Reviewing files that changed from the base of the PR and between 23a2113 and 68d4c13.

📒 Files selected for processing (2)
  • crates/perry-codegen/src/gc_map.rs
  • crates/perry-codegen/src/gc_map_tests.rs

📝 Walkthrough

Walkthrough

The inline GC map test module moved to gc_map_tests.rs. The extracted tests retain coverage for platform-specific assembly rewriting, stack-map encoding, symbol handling, derived slots, and malformed input validation. Production logic did not change.

Changes

GC map test extraction

Layer / File(s) Summary
External test module wiring
crates/perry-codegen/src/gc_map.rs, crates/perry-codegen/src/gc_map_tests.rs
gc_map.rs loads the test module from the new sibling file. The file defines shared sample assembly fixtures.
Target and assembly rewrite coverage
crates/perry-codegen/src/gc_map_tests.rs
Tests cover address widths, target refusal rules, section names, assembler flags, symbol assignments, attributes, and rewritten stack-map output.
Encoding and validation coverage
crates/perry-codegen/src/gc_map_tests.rs
Tests cover repeat encoding, foreign registers, derived slots, corrupted streams, missing maps, and truncated headers.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/gc-map-split

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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