Skip to content

Decide target_map renames in one place, and list renamed exclusions - #38

Merged
anakanemison merged 1 commit into
mschaller/u02-validate-bazel-argsfrom
mschaller/u03-target-map-renames-one-place
Nov 9, 2026
Merged

anakanemison merged 1 commit into
mschaller/u02-validate-bazel-argsfrom
mschaller/u03-target-map-renames-one-place

Conversation

@anakanemison

@anakanemison anakanemison commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

A Bazel target mapped through target_map to an excluded CMake name was skipped by the diff but missing from excluded.bazel, because the summary checked the raw label. A new helper, _bazel_renames, makes the rename decision once; the diff and excluded_summary both use it, and the per-side summaries later in this series are built on it.

Stacked on #37 (tracking issue: #35). pytest tests/: 134 passed (132 on main). Lab proposal: support for P17.

🤖 Generated with Claude Code

exclude_targets holds CMake names. The diff applies target_map before
deciding participation, so a Bazel target mapped to an excluded CMake name
is skipped. excluded_summary, which reports what was skipped and why,
checked the raw Bazel label instead, so that target appeared nowhere in
`excluded.bazel`: skipped, but not on the record.

A new helper, _bazel_renames, returns each Bazel label with the name the
diff compares it under (today, the target_map entries whose label exists),
and is the one place that decision is made. diff_models renames the Bazel
views with it and, as before, also applies every explicit target_map entry
to dependency references (a map entry can align an external dependency
that has no target node). excluded_summary checks exclusion on the renamed
name while still listing the target under its Bazel label. The per-side
summaries later in this series use the same helper, so they count exactly
the targets the diff compares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anakanemison
anakanemison removed this pull request from stack #59 November 2, 2026 17:49
@anakanemison
anakanemison force-pushed the mschaller/u03-target-map-renames-one-place branch from 81b1ee5 to 57aed8b Compare November 2, 2026 17:50
@anakanemison
anakanemison added this pull request to stack #63 November 2, 2026 17:54
@anakanemison
anakanemison merged commit 7e8c93a into main Nov 9, 2026
2 checks passed
@anakanemison
anakanemison deleted the mschaller/u03-target-map-renames-one-place branch November 9, 2026 18:45
anakanemison added a commit that referenced this pull request Nov 9, 2026
When one source compiles into several libraries with different flags,
the differ compared only one variant per side, and which one depended on
set iteration order, that is, on `PYTHONHASHSEED`. Pooling now keeps
every variant, visits targets in sorted order, and compares each CMake
variant with its best-matching Bazel variant (fewest errors, then
warnings, then the smallest difference, then a stable order). A source
with one variant per side takes the old path unchanged.

In any2bazel-lab, the same MySQL Server models gave 4,715 to 4,817
errors over 10 seeds, and a Blender migration's final models converged
under 2 of 8. With this change, a later QGIS run's verdict was the same
under three seeds. A `source_map` token that collapses several CMake TUs
now yields one comparison per distinct TU, so the worklist can grow.

Stacked on #38 (tracking issue: #35). `pytest tests/`: 140 passed (132
on `main`). Lab proposal: P14.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants