Repository navigation
Move native source acquisition into the typed filesystem fold - #12391
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c3d566a76
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let body_scope = fold(uses, init: body_scope, f: (s, u) => | ||
| extend_scope(scope: s, name: resource_use_name_at(n: u, source_indices: si), resolved: resource_use_resource(n: u), provenance: SubValueUnknown) | ||
| ) | ||
| let use_tco = is_tco_eligible(id: DeclaredCallableIdentity { owner_module_path: scope.module_name, decl_name: name }, body: body, registry: registry, source_indices: si) |
There was a problem hiding this comment.
Resolve tail self-calls by callee identity
When an effectful function has a function-valued parameter or local binding with the same name as the enclosing declaration, inference treats a call through that binding as LocallyBoundCall, but is_tco_eligible and emit_typed_tco_body recognize self-calls by spelling alone. For example, an effectful fn run(run: fn(Int) -> Int, n: Int) { run(n) } now bypasses the recursion refusal and is lowered into a loop instead of invoking the callback, potentially looping forever or assigning call arguments to the enclosing function's incompatible parameter slots. Use the call semantics' declared target identity, not the callee text, before enabling this effectful TCO path.
Useful? React with 👍 / 👎.
#12391's modeled filesystem acquisition is on main, so the two changes that touch the emitted driver area meet here rather than racing: modeled acquisition plus modeled demand scheduling and observation. A merge commit rather than a rebase, so the published checkpoint 44419a1 and every head the receipt cites stay reachable and unrewritten. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> # Conflicts: # src/v1/stage0/src/v1_compiler_emit_rust.rs
Native source acquisition lived in rendered Rust driver text. The CLI and eval driver now use
gunbc.source_root_readover the existingFilesystem.Read/Filesystem.Listservice and typed listing/read outcomes. Missing roots, failed listings, and unreadable bytes produce located refusals instead of an incomplete ingest. The CLI main binds the service and callsv2_cli_mainonce; witness construction remains insource_authority.The traversal exposed two missing native realizations. Effectful tail self-calls now use the existing loop lowering with fixed service bindings; non-tail recursion admission reads the same derived effect fact as emission. Native crate assembly now preserves the emitted Cargo manifest’s dependencies and features instead of overwriting them with the foundation-only roster, which omitted Tokio. Permanent controls cover both defects.
Validation at final head
6a09b68e85b:emit-builddetector job passed. Self-host accepted its clean root and refused its poison specimen. The built native CLI emitted the fixture’s Rust and refused no-entry, missing-root, and unreadable-source controls with the expected exit status and located causes.first_generation_equal=true, and exited 0 (616.948 seconds).6a09b68e85b47bf06dd23e0c9c3435477c27f14f.Scope: this removes only the filesystem portion of
source_root_eval_driver_seed_growth; its remaining obligations keep the row live. The legacy content-onlyfilesystem_readhelper remains. The six acquisition tests are local qualification; the CLI controls also run in the existing non-requiredemit-builddetector job. This does not establish generation-two compiler correctness.