Skip to content

test: independent C-frontend PRs conflict at shared anchors in c_parse_internal.h (seam comment, declaration spots) and c_frontend_tests fixture registrations #1735

Description

@davidgmbb

Summary

Independent C-frontend PRs conflict with each other in three places where additions tend to land at the same anchor line, even though the changes themselves don't overlap.

  1. Seam comment. The file comment in c_parse_internal.h lists every test-seam group in one sentence ("Private test seams for production constexpr, call arity, expression typing, …"). Every PR that adds a seam group rewrites that sentence.
  2. Seam anchors. New seam declarations in c_parse_internal.h go either at the end of the file, just before #endif, or right after the same existing declaration.
  3. Fixture anchor. A new BUSTER_TEST_FIXTURE(arguments, c_test_…) line in c_frontend_tests (c_test.c) tends to go right after a recently added fixture, so PRs branched around the same time often pick the same anchor line (unverified as a rule; the anchor counts below are what I measured). New test-function definitions cluster the same way.

Expected: two PRs that add unrelated seams or tests merge in either order without manual resolution.
Observed: such pairs conflict. The resolution is always "keep both sides", but it is done by hand and costs a revalidation cycle and a new CI run.

Evidence

Revision: main 425b8b5. Open PR heads were fetched at about 2026-09-28 07:30Z.

Hit on #1523. Three of its four main merges conflicted only at these spots. Each was resolved by keeping both sides.

#1523 merge main Conflicting main change Where
22bc3bb 3b3182f #1551 (15967ef) seam comment and seam anchor (#endif)
abba551 7d236db #1616 (0b4a547) a new test function inserted at the same line (c_test.c:3005)
df5ee15 6af2c9e #1382 (ea04c03) seam comment and fixture anchor

Across open PRs. 42 of the 98 open PRs change c_test.c or c_parse_internal.h.

Fixture anchor, #1695 × #1699:

<<<<<<<
    BUSTER_TEST_FIXTURE(arguments, c_test_constant_expression_syntax);
=======
    BUSTER_TEST_FIXTURE(arguments, c_test_sizeof_statement_expression_operand);
>>>>>>>

Seam comment, #1463 × #1523:

<<<<<<<
// label-provenance gate, validation-candidate and layout-solve queries.
=======
// label-provenance gate, validation-candidate and type-compatibility walk queries.
>>>>>>>

Prior record: #1041 (closed) is a merge that silently dropped a regression test. #403 (closed) settled a single add/add conflict on this header between two PRs. This issue is the recurring form.

Affected symbols

  • src/buster/lib/compiler/frontend/c/c_parse_internal.h:
    • lines 3–4, the file comment;
    • the declaration block (14 BUSTER_F_DECLs on 425b8b5), in particular the end before #endif and the spots after c_test_aggregate_lookup_rollback and c_test_parse_direct_expression_type.
  • c_frontend_tests in src/buster/tests/compiler/frontend/c/c_test.c: 165 c_test_ fixture registrations, plus the test functions defined next to their neighbours.

Validation already run

Only the git merge-tree classification above. It has no compiler or test component.

Possible repairs (not evaluated)

  1. Drop the seam-group list from the file comment. Each declaration group already has its own comment. This removes conflict 1 outright.
  2. Give additions a position determined by their content. For example, keep seam declarations and fixture registrations sorted by name, or grouped by owning area and sorted within each group. Then state the rule in docs/agents/testing.md. Independent additions would then land at different anchors unless their names are adjacent.
  3. Not recommended: a merge=union attribute on these files. It would also union unrelated hunks elsewhere in c_test.c and could silently duplicate code.

Remaining uncertainty

  • Fixture order: I did not check whether the order of fixtures in c_frontend_tests matters, for example through shared scratch arenas, the memory and timing reports, or the inline tests that follow the list. Option 2 needs that answered first.
  • Snapshot: the pairwise results use today's heads. Several heads are up to 221 commits behind main, so the set of conflicting pairs will shift as main moves.
  • Test-function conflicts: "inserted at the same line" is classified only by hunk location. Some of those pairs may be touching related tests rather than just sharing an anchor.

Completion criteria

  • Two PRs that each add one seam group to c_parse_internal.h merge in either order without a conflict.
  • Two PRs that each add one unrelated fixture to c_frontend_tests merge in either order without a conflict. If sorting is chosen, this excludes names that sort next to each other.
  • Where new seams and fixtures go is written down in the testing guide.

Found while driving #1523 (tracking #1520).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions