Skip to content

Consolidate native codegen at a verified Windows MSVC revision - #281

Merged
vycdev merged 492 commits into
mainfrom
codex/native-codegen
Oct 31, 2026
Merged

vycdev merged 492 commits into
mainfrom
codex/native-codegen

Conversation

@vycdev

@vycdev vycdev commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Consolidate the native-codegen campaign for review at de4852917e2432078cce990c5d98b49ad24b7e49. The plain workspace command now passes on Windows MSVC (x86_64-pc-windows-msvc). This PR remains a draft.

The landing repairs separate canonical builder identity from source-visible reflection metadata and include inherent struct methods in original closure Source lookup. Native parity means the five fixture gates in tests/native_parity.json passing at one commit on Windows MSVC.

Profile change: Cargo.toml declares [profile.test] with opt-level = 1, making the test settings reproducible without environment overrides.

Doc move: 59 campaign notes moved from docs/active/ to docs/completed/native_codegen/; the active gaps, ABI and ownership contracts remain active.

Both actor-graph tests honor JETT_ACTOR_GRAPH_BUNDLE_MANIFEST when supplied and otherwise use the same host- and profile-matched Cargo-built jett_native_launcher fallback as native conformance. Both pass without a supplied manifest. The archived Resource runner link is also repaired.

Verification at the above SHA, without CARGO_PROFILE_*, JETT_* or other build environment overrides:

  • cargo fmt --check: passed.
  • git diff --check: passed.
  • cargo test --locked --workspace --no-fail-fast: 4,260 passed, 0 failed, 26 ignored; exit 0.
  • Workspace wall time: 1h 39m 30.55s (5,970.55 seconds).

The first workspace run passed. No new ignores or temporary-file retries were added; the 26 ignored tests are existing opt-in tests. Both tests that previously encountered temporary-file permission errors passed in this run.

Campaign pipeline, historical verified landing and exact gate commands.
Remaining native gaps and language-rule review.

GitHub CI stays disabled. No merge or work from the gap list is included. Supersedes #279 and #280 for review.

… gates

Port the Windows conformance suite to Linux GNU and include verify/property execution in the standalone report. Keep fixture completion distinct from pending release gates. Allow a bounded 60 seconds for large debug-runtime JSON suites.

Validation: existing Linux native_execution 18/18; failing-source suite probe passed; parity example unit test passed; focused nested JSON decoder passed with the 60-second watchdog. The exhaustive conformance and standalone inventory audits remain running.
Keep caller scopes out of interpreter breakpoint snapshots and preserve declared closure capture types. Record the lexical-frame decision and cover direct/indirect calls, same-named caller bindings, nested-scope exit, captures, and return to the caller against native output.

Validation: 298 jett_comptime tests passed; native debug differential test and focused breakpoint frame regression passed; cargo fmt and git diff --check passed.
Validate explicit build targets before source loading and accept only the current supported native host. Keep the current frontend-only CLI behavior explicit in the native parity plan.

Validation: both CLI target integration tests passed; cargo fmt and git diff --check passed.
Grant context-bound opaque authority for Stderr, Stdin, Filesystem, Network, Process, and Log. Include these values in MIR ownership planning, native entry signatures, calls, task wrapping, joins, and debug output. Pending provider effects remain explicitly unimplemented.

Validation: six-family interpreter/native differential test passed; MIR, Cranelift, runtime, and external ABI suites passed; nominal/context-bound authority test passed; cargo fmt and git diff --check passed.
Use native test lowering so verify-only and property-only fixtures emit reachable body symbols instead of being misreported as empty objects.

Validation: native_test_object_emits_checked_verify_and_property_bodies passed; git diff --check passed.
…output

Preserve declared aliases and inferred binding types, including generic handlers and pipelines. Validate recursive redaction and seven reflected failure paths against linked native output. Debug conformance and affected compiler/runtime crate tests pass. The broader pre-change workspace run identified two native_values failures still under investigation.
Carry compiler ownership exclusions into HIR, interpreter, comptime, and test runners. Restore visibility after mutable assignment and isolate actor handler frames. Validated affected compiler crates, 166 run-pass fixtures, eight native debug tests, and both breakpoint differential tests.
…ion ABI

The C probe now supplies the environment handle and scalar pending-depth lane. Replace the obsolete rejection of owned field reads with a native/interpreter lifetime test proving the copied field survives consumption of its parent. The other 51 native_values tests passed in the full run; the corrected dynamic-input probe passes separately.
Discard complete trace and breakpoint observations before MIR lowering, including conditional side effects. Expose native driver BuildOptions and use Cranelift speed optimization for release objects. Linked debug/release behavior and debug-print rejection pass, as do affected codegen, HIR, and checker tests.
vycdev added 21 commits October 16, 2026 10:43
Box the complete private field target and call certificate without changing equality or checked identity. The unchanged Windows capture regression reproduces overflow before the repair and passes after it. All 9 CLI capture tests and 765 HIR/MIR/codegen library tests pass; cargo fmt and diff checks pass. Full native and workspace acceptance remain pending; GitHub CI stays disabled by request.
Keep the exact captured frontend and HIR failure oracle using an admitted nested temporary view, and retain all 23 readonly-root diagnostics with the correct E0401 borrowed-match origin. Focused controls, all 4 projected-assignment tests and all 603 frontend fixtures pass locally. Rust formatting and diff checks pass. This supplies no full native/workspace acceptance; GitHub CI remains disabled by request.
Restore the established reference/native pending-actor diagnostic and assert the exact reference message before full native output comparison. The focused conformance test passes with the reused Debug Runtime; all 663 Comptime library tests pass. Runtime and ABI are unchanged, all 68 Runtime guards match, and GitHub CI remains disabled. Broader workspace/native acceptance is pending.
Authenticate original ordinary calls and pipeline steps before selecting canonical struct/bitfield owner data. Keep full metadata comparisons, source alias information and empty outer alias/refinement probes. Make the interface fixture retain independent actor state through explicit clone. All 666 Comptime, 97 Driver, 603 fixture and 9 CLI capture tests pass; the original interface passes fresh default checking, formatting and Debug native/reference parity. Its Release attempt retains existing debug-println policy errors. Full workspace/native acceptance remains pending; CI remains disabled.
Keep the exact owned producer result in private lexical storage while local and forwarded views borrow it. Authenticate the original checked function/call/projection and preserve owning result acquisition before scope cleanup across HIR, MIR and checked reference execution.

Retain canonical mutual declaration identity and distinguish genuine written view declarations from existing borrowed pattern/iteration bindings.

Validation: 1,842 compiler-library tests, 603 fixtures and nine CLI capture tests pass. Fresh native gate and 23 tests / 46 Source-deleted native executions pass, paired across Debug and Release Runtime profiles. All Source, fixture and measured Runtime guards remain unchanged. cargo fmt --check passes.

This checkpoint covers finite ordinary function-body byte endpoints. List reference transport and the broader selected temporary-view lifetime/cleanup contract remain active work. GitHub CI remains disabled at the user's request.
Keep List endpoints in the existing whole-owner temporary storage and pass nonowning tickets through authenticated named and generic calls. Select each exact retained specialization using its canonical declaration identity, including mutual declarations, before argument effects.

Support borrowed length, defined numeric sum and copyable-item get observations, with whole-list copying only through explicit clone. Add a genuine producer/forwarding/bounds/clone-independence fixture and private specialization refusal controls.

Validation: 1,847 compiler-library tests, 603 fixtures and nine CLI capture tests pass. All 17 temporary transport controls pass within that library total. Repaired fixture passes Debug/Release frontend checks and a focused paired Source-deleted native run. The full fresh 24-test/48-execution Source-deleted native matrix passes, paired across Debug and Release Runtime profiles, with all Source/fixture/Runtime guards unchanged.

Move-only item get, broader temporary producer/body contexts and measured physical cleanup remain active work. No Runtime or ABI changes; GitHub CI remains disabled at the user's request.
Peer ownership checks previously reran canonical coercion independently, creating distinct reflected-callable identities for the same checked input and rejecting valid composition. Retain the one actual conversion output in a private ephemeral receipt and replay it only for the complete original input and same type arena.

Keep actor, mutable-sum and temporary proof checks exact, compare every protected archive identity even without original data, and publish the converted Program only after all peer/sealing/HIR/backend validation succeeds.

Validation: all nine focused canonical controls, the genuine required-callable/temporary positive in both checking modes, and the existing Graph/baked/temporary composition pass. All 1,856 compiler-library tests, 603 fixtures and nine CLI capture tests pass. A fresh current-compiler native regression passes 24 tests / 48 Source-deleted executions, paired across Debug and Release Runtime profiles, with all Source/fixture/Runtime guards unchanged.

This does not establish native execution of the compound required-callable witness or Verify/Property suite completion. Runtime/ABI are unchanged, and GitHub CI remains disabled at the user's request.
Retain exact checked Verify/Property factories, original required-value cache identity, complete function tables, and occurrence-specific suite receipts through canonical conversion. Emit the distinct native-suite role through the existing Resource scope ABI.

Stage authenticated ordinary-endpoint Resource-family calls through ordered expression lowering, preserving lexical and named-argument order and short-circuit branches. Keep carrier, hook, and indirect transport bounds explicit.

Validation: 1,867 compiler library tests, 603 fixtures, 9 CLI tests; fresh native image passes unchanged whole Source17 (4 objects/8 processes/8 private entry attempts), 24 view tests/48 paired executions, and the original 191 Resource lifecycle cases/382 paired Source-deleted executions. All 1,067 Source and 68 Runtime guards remain exact; fmt and diff checks pass. Runtime ABI1 and measured bundles are unchanged.

Full coverage remains open. Source17 provider-attempt and successful-context-history instrumentation and broader storage/artifact lifetime measurements remain unmeasured. The local cache briefly reached8.095GiB during the CLI rebuild; exact obsolete test images/symbols were retired with Runtime guards preserved, restoring7.41GiB before native compilation. GitHub CI stays disabled.
Retain exact actor initializer/handler owners and checked scoped facts for explicit required-value evaluation. Keep runtime ActorHandler Resource cursor admission and native actor required-bake matching conservative.

Reject lazy required closures whose resolved free lexical bindings are absent from the compile-time worker. Preserve exact namespace constants, named functions and valid local, parameter and nested captures.

Validation: focused actor8 (included in Comptime691), HIR286, fixtures603, CLI units26 and capture9: 1615 distinct tests pass. Twelve exact-image CLI Debug/Release checks match expected acceptance/refusal. The original callable witness and RED capture Source are unchanged. No HIR/native actor execution acceptance is claimed. GitHub CI remains disabled.
Retain the exact checked actor initializer/handler owner, required cache and
actual bake input/output when replacing closed explicit comptime values.
Renew complete actor snapshots from the authenticated producer result.

Record the actual callable sealer's exact getter/adapter token edits and renew
the baked execution table from that retained output. Preserve every actor and
archive identity; keep MIR's strict original/current comparison unchanged.
Add the unchanged actor required-callable native witness for both profiles.

Validation: 2,539 compiler-library, fixture and CLI tests passed, including
11 focused actor/bake/sealing controls. One fresh native test emitted/linked
and executed the unchanged Source in Debug and Release after deleting isolated
Source/object inputs. Both exit 0 with exact observed:5 LF and empty stderr;
complete 1,081 Source and 68 Runtime before/after guards pass. Physical lifetime,
reentry, full workspace/platform and full native goal acceptance remain open.
GitHub CI remains disabled; draft PR 280 remains incomplete.
Renew initial actor snapshots from the actual callable sealer output using
the original checked context and a finite private epoch. Keep complete
historical/current validation and reject unrepresented proof transitions.

Preserve the unchanged direct-getter and required-value witnesses. Add
exact context, tamper, clone and Weak-expiry regression controls.

Validation: 2,546 local compiler, fixture and CLI tests passed; 18 focused
controls are included in that total. Both whole actor Sources passed
Source-deleted Debug and Release native executions with exact output,
cleanup and complete 1,086 Source / 68 Runtime before-after guards.
A wrapper-only PS5 receipt-publication failure was preserved unaccepted,
then corrected and rerun successfully.

The checker-valid actor plus temporary-owner composition and broader
native acceptance remain open. GitHub CI stays disabled.
Record separate acquisition pipeline stages, exact Property contexts and installed
int64 arguments in the double-private Runtime report protocol. Preserve the
production ABI and original Source programs.

Validation: 407 focused local checks; six freshly measured MSVC archives; accepted
fresh compiler gate; ingress32 processes (8 Source/10 entries, 22 host ABI, 2 recorder);
whole Source17 eight processes/four objects/eight private entries in paired profiles.
Source17 private Property history validates100 trials per entry and separate zero
acquisition counters without incomplete telemetry. Physical per-kind storage,
private retainers and normal-launcher custody/reentry remain unmeasured.

Preserved failed gate/preflight attempts grant no execution credit. GitHub CI
remains disabled. Exact evidence and remaining limits are documented in
docs/active/native_resource_private_observations.md.
Keep an owned mint-time construction inventory through the initial callable
sealer. Preflight the exact source, checked context, canonical producer and
peer epoch before filling retained temporary cells once. Ordinary lowering
keeps its existing finalization path.

The unchanged actor getter program now lowers and prints observed:5 through
both MSVC native profiles after Source and object removal.

Validation: 2553 local regressions passed, including 35 focused controls;
fresh compiler gate and two supervised native executions accepted.
GitHub CI remains disabled. Broader canonical compositions and physical
lifetime measurements remain open.
Authenticate direct optional/result Resource replacement as one compound operation. Preflight shells, loans, companions and exact Scope ownership before retiring the old value and publishing the independently owned replacement. Preserve first-error and exactly-once cleanup behavior.

Retain exact nested owned declaration records through MIR Scope exits, and pack primitive result failure payloads without inventing owned temporaries. Add paired Source-deleted native cases and small raw report evidence.

Validation: 3,038 distinct local checks; six freshly measured MSVC archives; accepted compiler gate over 1,111 inputs; three exact driver selectors. Native single/reentry validation accepts six Sources, 50 freshly built programs, 76 child runs and 114 entry attempts across Debug/Release, including expected failure paths.

Broader Resource carriers, pure-suite native execution, physical lifetime and full native/workspace/installed-host acceptance remain open. GitHub CI stays disabled.
Generalize the canonical suite harness over the original Source17 and pure replacement fixtures. Preserve required-cache values, original function/main identities, full checked Property plans and the existing Source17 oracle. Add an ordinary preparation control and a separate native evidence schema.

Validation: two ordinary controls pass; strict adapter/report controls pass; a fresh compiler gate covers 1,111 inputs using the same six measured archives. Pure Verify/Property suites accept eight native processes, four objects, eight private entry attempts and 400 actual private Property trial calls. Fresh Source17 regression separately accepts eight processes, four objects and eight private entries. All process/input guards and cleanup checks pass.

Normal-launcher custody/reentry, per-kind physical lifetime and full native/workspace/installed-host acceptance remain open. GitHub CI remains disabled.
Preserve the incomplete ordinary corpus result and partial log without granting
acceptance. Record the later two-snapshot cleanup/lease release and v13 pure
supervisor controls (6 positive, 25 negative), separate from language execution.
Keep live optional/result shells and their ordinary failure companions in the
existing exact SelfRebind path. Preserve original Source/type/slot/scope and loan
authority, with no Runtime or ABI change. Add unchanged none/fail("kept")
witnesses and independent reference, MIR and object-emission controls.

Validation: 1,291 distinct Codegen/Comptime/MIR checks pass, including both
original witnesses through Debug and Release MIR/object checks. This is a
compiler checkpoint: zero linked native credit, no current fresh gate/full
ordinary acceptance, and occupied/unknown/companion/loan follow-up pending.

@vycdev vycdev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

🤖 gpt-6.1-sol responding on behalf of vycdev

Found two issues in the reviewed native build path; details and reproductions are inline.

Reviewed native arithmetic/proof assumptions, executable publication, CLI output paths, and packaging/runtime metadata. All 142 Cranelift backend unit tests and 18 focused native driver unit tests passed. Two temporary diagnostic probes reproduced zero-divisor native crashes (both int8 and int64) and Windows output-name collisions. The full workspace suite and Linux execution were not rerun; this is a focused review of the consolidation, not an exhaustive audit of all 2,117 changed files.

Comment on lines +3934 to +3937
let magnitude = self
.builder
.ins()
.udiv(dividend_magnitude, divisor_magnitude);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

🤖 gpt-6.1-sol responding on behalf of vycdev

[P2] Reject zero-valued refinement divisors before emitting native division

The current checker accepts type Wrapped = int64 where value + 9223372036854775807 + 1 < 0 as a nonzero-divisor refinement: its proof evaluates the predicate with checked i128 arithmetic, but the actual predicate wraps at int64, so Wrapped divisor = 0 handle error: ... succeeds. A function returning 8 / divisor then reaches this instruction with zero. I reproduced successful checking, object emission, and linking at this head; the executable exits with 0xC0000094 and empty stderr, while the interpreter reports runtime error: division by zero. The proof weakness predates this PR, but the new lowering turns the reported failure into an unhandled hardware exception and bypasses launcher cleanup. Make the proof evaluation respect the checked primitive width, or conservatively reject these proofs before native emission; division and remainder need the same protection.

Comment on lines +2387 to +2389
let mut destination = PathBuf::from("target").join(&host).join(profile).join(stem);
if cfg!(windows) {
destination.set_extension("exe");

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

🤖 gpt-6.1-sol responding on behalf of vycdev

[P2] Append the executable suffix to the complete source stem

file_stem() has already removed .jett, so set_extension("exe") removes another part of any dotted stem. On Windows, both hello.one.jett and hello.two.jett therefore select target/<host>/debug/hello.exe (reproduced using this exact path construction). Building the second source silently replaces the first executable through the normal publication path, and the artifact also disagrees with the documented source-stem default. Append .exe to the full stem instead of replacing its remaining extension, and cover dotted source names.

@vycdev
vycdev marked this pull request as ready for review October 31, 2026 09:39
@vycdev
vycdev merged commit 8d42e2d into main Oct 31, 2026
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.

1 participant