Repository navigation
ruff_r2il: harvest_6502 — the Probe C intake leg, run on real Elite images - #106
Merged
Merged
Conversation
…mages New lift-gated example: compile the sibling checkout's unmodified Ghidra 6502.slaspec at run time (sleigh-compiler dev-dep, the same crate C64-rs uses at build time), lift PRG-headed C64 images (2-byte LE load address, no symtab, no sections), partition each image at JSR targets — the 6502 stand-in for STT_FUNC — and run every partition through the existing ore -> furnace -> slag pipeline. Default corpus: the Elite reference binaries in the sibling elite-source checkout, read locally and never redistributed (artifacts carry FNV hashes and counts only); a missing corpus is a printed skip, never a failure. Two measured findings, each of which halved-then-fixed a collapse: 1. A whole PRG as ONE function loses everything the SSA entry cannot reach (CFG::from_blocks takes blocks[0].addr as entry) — first run measured 52 KB of Elite -> 38 classified facts. JSR partitioning is the fix, and the example's doc says why. 2. 6502 direct JSR/branch targets lift with SpaceId::Ram, not Const — the x86 harvest's Const filter silently discarded every call target (a probe printed the space distribution before the filter changed). Measured result on gma4/5/6 (COMLOD/LOCODE/HICODE): 62 JSR-partitioned functions, conservation 5198 harvested / 1456 classified / 3742 residual / 0 dropped. The slag is dominated by opcode_not_in_convention — the pass-1 seven excludes 6502 flag arithmetic by design, so the top slag shapes are pass 2's named work queue, not a defect. Artifacts under .claude/harvest/r2il-6502/ (ore.tsv / census.md / slag.tsv / convention.toml / PROVENANCE.md) — evidence, never a re-ingest path.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_def4f78b-b5a8-45d8-b262-a9009107fe24) |
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.
What
The C64/6502 intake leg of C64-rs's Probe C, as a new
lift-gated example in the workspace-excludedruff_r2ilcrate: compile the sibling checkout's unmodified Ghidra6502.slaspecat run time (sleigh-compilerdev-dep — the same crate C64-rs uses at build time; this crate vendors nothing), lift PRG-headed C64 images, partition at JSR targets, and run every partition through the existing ore → furnace → slag pipeline. No library code changes — the arm was already architecture-agnostic, which is the point being proven.Default corpus: the Elite reference binaries (
gma4/5/6.bin= COMLOD/LOCODE/HICODE) in the siblingelite-source-code-commodore-64checkout. Licensing posture (operator-ruled): read locally, never redistributed — artifacts carry FNV hashes and counts only; a missing corpus file is a printed skip, never a failure, so the example runs on any checkout.Two measured findings (each fixed a real collapse)
CFG::from_blockstakesblocks[0].addras entry; first run measured 52 KB of Elite → 38 classified facts. Fix: JSR targets partition the image — the 6502 stand-in forSTT_FUNCon a symtab-less format.SpaceId::Ram, notConst. TheConstfilter copied from the x86 harvest silently discarded every call target (a probe printed the space distribution before the filter changed). Bothfind_call_targetsandfind_leadersnow acceptConst | Ram, with the finding recorded at the filter.Measured result
Conservation: 5198 harvested / 1456 classified / 3742 residual / 0 dropped. Slag is dominated by
opcode_not_in_convention— the pass-1 seven excludes 6502 flag arithmetic by design, so the top slag shapes ARE pass 2's named work queue, not a defect. Artifacts under.claude/harvest/r2il-6502/— evidence, never a re-ingest path.Context
Companion PRs this session: OGAR astral-sh#284 (mints
0xC6XX Mmio, C64 founding tenant), C64-rs #11 (fence widening + Probe C route record). The harvest lives HERE becauseruff_r2il's path deps escape the ruff repo (sibling-checkout-only crate) — consuming it from c64-rs as a git dep would create twor2ilSourceIds and two incompatible type universes.Gates: example builds + runs (
--features lift),clippy --example harvest_6502 -- -D warningsclean,cargo fmtclean (crate-scoped — workspace-excluded).Generated by Claude Code