Skip to content

Evaluate native static control in its checked argument and local context - #1396

Closed
julia-script wants to merge 11 commits into
selfhostfrom
selfhost-static-function-control
Closed

julia-script wants to merge 11 commits into
selfhostfrom
selfhost-static-function-control

Conversation

@julia-script

@julia-script julia-script commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Superseded by #1402 (fa2a86b1c12ad1566b8f0d98df0647b8458a904e). Closing this draft without merging its separate history. Source containment/conservation preserves the authored phase-field/static-control claims and helper behavior in the unified feature. Its actual fifteen-actor production runner passes; both verified hosted N0/N1 generations pass the mandatory five programs and eight normal-stack depth probes, and N1 passes all eleven authored examples. The historical N0 depth signals are retired. Exact-head CI is fully green: https://github.com/silk-lang/silk/actions/runs/38067183162.

#1402 remains a draft pending recovery and execution of the original frozen ownership controls. This closure does not waive that gate.


Native static functions currently check a static-if condition before their evaluator arguments and locals exist. A condition such as let chosen = input; static if chosen therefore rejects instead of selecting, and static-for inside a static function has no checked iteration scopes. This blocks the static validation helpers used by format and json_reflect.

Checked static-function bodies are now keyed by complete application and argument values. Control boundaries evaluate authenticated typed prefixes from those arguments, retaining local mutation without replaying nested mutations twice. Each static-for scope keeps its concrete element type and checked node range; execution uses that range for calls, intrinsic types and projections. Reached static conditions collect their own call and annotation facts before typed-prefix evaluation, including sealed profile intrinsics; inactive branches remain silent. Changed selections inside ordinary control refuse SEM0176 before publishing a wrong result. Runtime mixed selection retains its nested iteration tree rather than refusing nested static-for syntax.

Claims cover opposite arguments, mutable and nested selections, early return, phase-only locals, per-iteration mutation, heterogeneous reflected descriptors through a generic helper, zero-element body silence, exact selected CompileError spans, changed-loop refusal, nested mixed scopes, and failure atomicity. The focused coordinated root also runs the existing static recursion, string, aggregate ordering and Drop refusal actors.

Validation update: the coordinated v3e compiler source and 44 actor bodies compiled; nestedMixedLoopsRetainIndependentIterationContexts and both existing recursion/aggregate actors passed. The new control actor failed at the helper-returned iterable sum; the sealed profile query failed because its closed abstract Body query lacked an application. Corrections are prepared and the focused10-actor v4 run is active. Runtime/corpus proof remains pending.

Earlier validation: fresh bootstrap-next full compiler source check passed at local f9c87a0df (1 succeeded, 0 failed). The subsequent change removes the nested-loop refusal and adds/tightens claims; parse and diff checks pass. Bootstrap provenance checks pass. Behavioral claim execution, exact-head N0 CI and the requested template-formatting/logging-composition/language-pressure-stack-vm corpus proofs remain pending; this is a draft. Depends on #1376 for phase-only aggregate field admission. Ordinary-control selection changes remain an explicit diagnosed boundary, matching the bootstrap correction in #1394.

claude and others added 7 commits October 10, 2026 03:28
STATIC-009: a struct or tuple may hold an Intrinsic.StaticSequence or
descriptor field. resolveMemberShape no longer rejects phase-only member
types; phaseOnlyType walks struct and tuple fields transitively, so a
runtime parameter, result or failure of such a type and an embedded static
value of it report StaticPhaseViolation. The LIFE-003 field scan treats
Intrinsic.Type and Intrinsic.StaticSequence as sealed families.
COMPILER_COMPATIBILITY.md records the bootstrap's SEM0219 divergence.

Work in progress: Cases and corpus verification not yet complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EWoV5Yzbu782pFaVwhcaRv
@julia-script
julia-script deleted the selfhost-static-function-control branch October 18, 2026 21:37
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.

2 participants