[AUTOMATED] Add per-run ledger for globals retyped as a whole (#1246)

Merged
CO
7d ago
+134-0

User description

[AUTOMATED] Refs #1246. Adds the per-run ledger for globals retyped as a whole.

What changed

  • crates/unlace-bandb-core/src/p5_types/globalretype.rs: RetypedGlobals<T>, keyed by (address-space index, first offset). A later record for the same start keeps the larger object. covering() answers for every byte of a recorded object. Ledger = RetypedGlobals<Rc<Datatype>> is an ArchTables entry, so it is per-run and not persisted.
  • crates/unlace-bandb-core/src/p5_types/mod.rs: registers the module.

Not in this PR

  • Behavior wiring (access collection and a default-off reader) is not in this PR; see the issue comment for the blocker.
  • No pass records into the ledger and no reader consults it, so there is no behavior change and no option or spec change.
  • Still open for #1246: access collection that feeds the ledger, and the global symbol-type readers that would consult it behind a default-off option. The datatests (675/675) need a measurement run after those land.

Verification

  • Run lane on fix/i1246 at 9bf3950899 (nextest, unlace-bandb-core, filter test(/globalretype/)): 5 tests run, 5 passed (covers_every_byte_of_a_recorded_object, other_spaces_are_not_covered, smaller_record_does_not_narrow_the_object, larger_record_replaces_the_object, empty_ledger_covers_nothing). Stage files: none.

Model: claude-haiku-5-5


CodeAnt-AI Description

Add a per-run record for whole-global retyping decisions

What Changed

  • Records global objects by address space and starting address; lookups find the object from any byte it covers.
  • A smaller later record cannot shrink an object; an equal or larger record replaces it.
  • Records last for one analysis run and are not yet used by analysis, so current analysis results do not change.

Impact

✅ Global records stay scoped to one analysis run
✅ Lookups find objects from any covered byte
✅ Smaller records cannot narrow an existing object

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.