Close the remaining accepted first-release static-boundary gaps. - #39
Merged
Conversation
Permit native-call conformance tests to install an adapter only when its resolved symbol and complete static signature match canonical MIR. Validate closed ABI values at the call boundary and balance PLRI foreign transitions before propagating adapter failures.
Define the typed function/context callback contract before exposing callbacks at source level. Retain managed capture environments behind opaque site-checked contexts and balance blocking or attached-thread managed entry through PLRI and native ABI 1.18.
Bind each foreign record parameter and result to its verified target catalog layout in canonical MIR. Marshal declaration-ordered fields into the native ABI shape before a direct external call and reconstruct managed records only after the balanced foreign transition returns.
Add target-owned generator plans and a bounded canonical .popc parser so native layouts, signatures, and pointer policies remain typed Pop contracts. Publish reviewable bindings and typed inventory metadata atomically without shell, header, host, or dynamic lookup authority.
Reject missing, altered, symlinked, or mismatched .popc generations before package source discovery. This prevents ordinary check and build commands from consuming output that no longer matches the manifest-selected descriptor and target.
Fix the first-release interface-to-class cast contract before implementation. Choose target-type call syntax and typed optional absence, then define exact and descendant identity, visibility, metadata, IR, diagnostics, and backend conformance without reflection or unchecked fallback.
Close the callback generator and pair-selection contract before backend\nlowering. Keep schema 1 callback-free, add typed .popc schema 2\nattachments, and select fixed C or System thunks only at a verified\nlexical pair use so owned registration remains ABI-neutral.
Carry declaration-ordered public record layouts and their canonical target\ncatalogs across Bubble boundaries. Consumers can verify and remap exact ABI\nfacts without reconstructing producer declarations or using reflection.
Schema 2 cannot authorize public foreign declarations without widening its\nclosed generated-source grammar. Keep callback policy inside the owning\nBubble and require Packages to expose ordinary typed safe wrappers.
Parse schema-2 callback-pair descriptors and retain their closed ABI, lifetime, thread, fingerprint, and policy facts as typed compiler data. Require every lexical pair scope to use one compatible generated contract. Reject unattached, unused, lifetime-mismatched, or ambiguous uses before HIR.
Carry generated callback contracts and public record-layout catalogs through resolution, HIR, and canonical MIR. Emit fixed typed LLVM callback thunks for C and System ABIs, preserve declaration-order by-value marshalling, and reject forged or mismatched metadata before lowering.
Preserve exact callback owner, function, context, and captured environment identities across scoped and registered lifetimes. Route callback entry, leave, and close through typed PLRI failures and reject unavailable or mismatched pairs before managed execution.
Fail capability validation when canonical MIR contains callback lifecycle or pair operations. The experimental backend must not lower callbacks through raw pointers, partial RTTI, or a dynamic fallback.
Close the first-release architecture for narrow retained codec schemas and immutable Text/Bytes views. Make typed retained-adapters.popc the sole adapter schema and generation source, and require compiler-proven lender provenance, retention summaries, escape checks, and backend-neutral view MIR without runtime reflection or borrow fallback.
Close the accepted FFI, borrowed-view, checked-cast, effect, and generated codec adapter gaps. Preserve typed .popc metadata, exact cross-backend semantics, and explicit C rejection without dynamic fallback.
Contributor
|
This PR is large and would use a significant portion of your monthly review quota. Comment |
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.
Summary
Close the remaining accepted first-release static-boundary gaps.
This change:
deterministic
.popcbinding generation;calls;
Text.ViewandBytes.Viewlifetimes;the native runtime;
views;
Architecture traceability
.popcgenerated-binding and retained-metadata descriptors;ROADMAP.md.Verification
cargo fmt --all -- --checkcargo check --workspace --all-targetscargo test --workspace --all-targetscargo clippy --workspace --all-targets -- -D warningsIf a check was not run, explain why:
The complete workspace-wide test and Clippy commands were not run. The full
driver suite, native runtime suite, and architecture-regression suite passed,
including the FFI, casts, effects, views, retained-metadata, interpreter, LLVM,
and fail-closed C coverage affected by this change.
Review notes
The experimental C backend deliberately rejects unsupported callback and view
operations. It is not treated as a parity target for this release.
Summary by cubic
Closes the remaining first-release static-boundary gaps by adding typed FFI callbacks/layouts, deterministic/verified
.popcbindings, checked interface→class casts, compiler‑provenText.View/Bytes.View, exact retention/provenance summaries, and generated codec adapters across MIR, LLVM, and the runtime; the experimental C backend fails closed for unsupported features.New Features
.popcwith pre-build verification; by‑value record marshalling and schema‑2 callback pairs with fixed LLVM thunks and MIR‑interp support.FileReader(reader)) returningClass?, with focused diagnostics.Text.View/Bytes.View: non‑allocating views with MIR ops, LLVM lowering, interpreter support, and escape/suspension diagnostics.@RetainMetadata(use = Metadata.Use.Codec): canonicalretained-adapters.popcas the source of truth and a siblingCodec.Schema<T>Item resolved at compile time.Migration
[platform."<triple>".ffiGenerators]entries and runpop ffi generate --manifestPath <bubble.toml> --platformTarget <triple>; commitbindings.pop,native-bindings.popc, and any shim C unit. Builds now verify these before compilation.@RetainMetadata(use = Metadata.Use.Codec, schemaVersion = 1)on eligible types and reference the generatedCodec.Schema<T>(e.g.,UserSchema); artifacts now includeretained-adapters.popc.ClassName(value)) and handle the optional result.Text.View/Bytes.Viewdo not escape their lender or cross suspension; materialize withText.toString/Bytes.toBytesif a longer lifetime is needed.Written for commit c56e2c7. Summary will update on new commits.