Skip to content

Fix actor/task flow fixed-point convergence#8

Draft
BoSuY0 wants to merge 1 commit into
mainfrom
fix/flow-fixed-point-actor-task
Draft

Fix actor/task flow fixed-point convergence#8
BoSuY0 wants to merge 1 commit into
mainfrom
fix/flow-fixed-point-actor-task

Conversation

@BoSuY0

@BoSuY0 BoSuY0 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the inherited actor/task semantic flow fixed-point blocker:

TestActorTaskBoundedStressExamples/task_bounded_stress
examples/tasks/task_bounded_stress.tetra:14:5:
flow fixed point did not converge

This is semantic flow fixed-point convergence cleanup, not actor feature work.

Root cause

The loop-local task handle in task_bounded_stress.tetra was assigned a fresh resource id on each loop fixed-point iteration. core.task_join_i32(task) marked that id as finalized, then scope cleanup removed the scoped resourceVars["task"] path but left the id-keyed finalizedResources[id] fact behind. The fixed-point state therefore grew by one orphan finalization id per iteration and never converged within the existing limit.

The fix prunes id-keyed resource flow facts when a scoped local resource path is removed and no remaining resource path references that id.

Scope / nonclaims

  • fixes inherited actor/task flow fixed-point blocker;
  • no Actor Core v2;
  • no distributed actors;
  • no actor runtime behavior change;
  • no Memory Core change;
  • no optimizer change;
  • no .t4i or .tobj change;
  • no release approval;
  • no security signoff.

Validation

Focused:

go test -buildvcs=false \
  ./compiler/tests/ownership/actor_task/... \
  -run 'TestActorTaskBoundedStressExamples|FlowFixedPointActorTask' \
  -count=20 \
  -v

Result: pass.

go test -buildvcs=false \
  ./compiler/internal/semantics/flow \
  -run 'FixedPoint|Join|Digest|Actor|Task|Await|Callable' \
  -count=20

Result: pass.

go test -buildvcs=false \
  ./compiler/internal/semantics/... \
  -run 'FixedPoint|Actor|Task|Transfer|Await|Callable' \
  -count=10

Result: pass.

Guards:

go test -buildvcs=false \
  ./compiler/internal/actorsafety/... \
  ./compiler/internal/actorsrt/... \
  ./compiler/internal/parallelrt/... \
  ./compiler/actorwire/... \
  ./cli/internal/actornet/... \
  -count=5

Result: pass.

go test -buildvcs=false \
  ./compiler/internal/t4iface \
  ./compiler/internal/format/tobj \
  ./compiler/internal/buildlink/... \
  -count=3

Result: pass.

go run ./tools/cmd/verify-docs --manifest docs/generated/manifest.json

Result: pass.

Broad delta:

  • go test -buildvcs=false ./compiler/... -count=1: red from inherited baseline failures only; compiler/tests/ownership/actor_task is now green.
  • go test -buildvcs=false ./cli/... ./tools/... -count=1: red from workspace wrapper around the same inherited compiler failures.

Inherited remaining classes include ownership diagnostic mismatch, selective-import actor payload diagnostics, secret/capsule effects diagnostics, and surface frame diagnostic wording.

Prune id-keyed resource flow facts when a scoped local resource path is removed and no remaining resource path references that id.

Root-cause: loop-local task handles left orphan finalizedResources entries after scope cleanup, so fixed-point digests grew by one stale resource id per iteration.

Constraint: no Actor Core v2, no distributed actors, no actor runtime behavior change, no Memory Core/optimizer/.t4i/.tobj/release changes.

Rejected: increasing fixed-point iteration limits or weakening actor/task diagnostics.

Confidence: high

Scope-risk: semantic flow cleanup for scoped resource facts.

Tested: go test -buildvcs=false ./compiler/tests/ownership/actor_task/... -run 'TestActorTaskBoundedStressExamples|FlowFixedPointActorTask' -count=20 -v

Tested: go test -buildvcs=false ./compiler/internal/semantics/flow -run 'FixedPoint|Join|Digest|Actor|Task|Await|Callable' -count=20

Tested: go test -buildvcs=false ./compiler/internal/semantics/... -run 'FixedPoint|Actor|Task|Transfer|Await|Callable' -count=10

Tested: actor core guard, safety guards, verify-docs, diff check.

Not-tested: external CI pending.
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