Repository navigation
Design: C realization of the shared CompilationUnit linkage-unit shape (R3 .h/.c + include-closure + link-cyclic; R4 permissive) - #6717
Merged
Conversation
…e (R3 .h/.c + include-closure + link-cyclic; R4 permissive) 2nd realization (against the interface locked with the Rust realization, docs/plans/emitted-crate-partition-design.md) staffed specifically to stress-test that the shared CompilationUnit shape doesn't bake in Rust's acyclic-linkage assumption. Verdict: yes, the locked shape expresses C's .h/.c split and link-cyclic axis without contortion — R3 renders members/interface into .c/.h, R4 accepts the cyclic partitions Rust R4 refuses and instead refuses on cyclic by-value type containment or a split symbol definition. One non-blocking richness call-out to the shared-home author: interface must carry full type definitions for by-value crossings, not just symbol names. Design only — implementation is gated on the shared home landing (sibling lane, adhoc-85078326-fdb) + main-green. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
briansrls
force-pushed
the
c-linkage-unit-realization-design
branch
from
July 16, 2026 05:10
aee7d08 to
8f9f539
Compare
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.
Design artifact (docs-only) — the C realization of the shared, target-agnostic
CompilationUnitcontract locked with the Rust realization (docs/plans/emitted-crate-partition-design.md, PR #6708). C is staffed as the 2nd realization specifically to stress-test that the shared shape doesn't silently cement Rust's acyclic-linkage assumption.Why C
Rust crates (and Go packages) require acyclic linkage; C translation units may mutually
#include/reference and still link cleanly. Proving the sameCompilationUnitshape expresses both — Rust R4 refusing a cyclic partition, C R4 accepting the identical cyclic partition — is the discriminating test that the shape is genuinely agnostic.What this doc covers
.h/.csplit renders the existingmembers(input)/interface(derived) fields — no shape change needed; cross-unit reference =#include+ forward-decl fromdeps; translation-unit identity = preprocessor include-closure;artifact=.o+ link step (extends the#6650cchost transport).v2.std.determinism/std.perturbation(partition = non-semantic perturbation axis, same as the Rust doc — no new concept). Four discriminating witnesses: 1-unit, N-unit-acyclic, N-unit-cyclic (load-bearing — proves the C axis), and a genuinely-invalid partition's typed refusal.adhoc-85078326-fdb):interfacemust be able to carry a full type definition for by-value boundary crossings, not just a symbol name — expected already true since it's an opaqueNodecarrier, flagged for confirmation, not filed as a shape-break escalation.Staging
Design only. Implementation is gated on the shared home (
CompilationUnit/partition_fold/R4 interface/Provenance) landing (sibling lane) + main-green, mirroring the Rust design doc's gating.🤖 Generated with Claude Code