KB-220D

50000x · 03 — Phase E durable scaleout N=20 (PASS)

4 min read Revision 1
iu-core50000xscaleoutphase-Edurable

50000x · 03 — Phase E durable scaleout N=20 (PASS)

Driver

ops/50000x-autoscope-refresh-scaleout-event-ops-closeout/scaleout/run_bounded_scaleout_n20.sql

Single transaction: BEGIN → open iu_core.composer_enabled and iu_core.auto_instantiate_enabled → PL/pgSQL loop calling fn_iu_auto_instantiate_from_event 4×5=20 times → close both gates → in-TX verification → COMMIT.

Gate toggle inside the same TX per [[feedback-in-tx-gate-toggle-reversibility]].

Mix

Template Kind N Suffix pattern
tpl:file:status-report/v1 file 5 50000x-bulk-file-v1-{01..05}
tpl:file:status-report/v2 file 5 50000x-bulk-file-v2-{01..05}
tpl:wf:onboarding/v1 workflow 5 50000x-bulk-wf-v1-{01..05}
tpl:wf:onboarding/v2 workflow 5 50000x-bulk-wf-v2-{01..05}

Per-call args: actor=iu-core-50000x-bulk, emit_mode=live, event_id=gen_random_uuid(), event_type=iu.template.instance_auto_composed.

Idempotency key per call = md5(event_id || ':' || template_id || ':' || suffix) — unique by construction.

In-TX result

NOTICE: 50000x scaleout: 20 instances composed (4 templates x 5 each)
50000x_lineage  | 37   (17 + 20)
50000x_auto_log | 33   (13 + 20)
50000x_actor    | iu-core-50000x-bulk | 20
50000x_digest_match | true | 20
50000x_gates_closed | iu_core.composer_enabled         | false
50000x_gates_closed | iu_core.auto_instantiate_enabled | false
COMMIT
50000x_post_commit | auto_log=33 | bulk_rows=20

All 20 calls returned status='ok'.

Post-TX invariants

iu                = 175           (UNCHANGED — instances reuse template pieces)
iu_piece_collection = 44          (24 + 20)
iu_piece_membership = 223         (118 + 105; avg 5.25 pieces per instance)
iu_lifecycle_log  = 146           (UNCHANGED)
iu_vector_sync_point = 152        (UNCHANGED)
digest_drift / digest_ok / total = 0 / 33 / 33

Digest sample

22bcfacc-... | tpl:wf:onboarding/v1 | tpl-inst:auto:50000x-bulk-wf-v1-04 | td=2d3d37b60fd32963 | id=2d3d37b60fd32963 | match=true
aca88b8a-... | tpl:wf:onboarding/v1 | tpl-inst:auto:50000x-bulk-wf-v1-03 | td=2d3d37b60fd32963 | id=2d3d37b60fd32963 | match=true
1bb2e8ea-... | tpl:wf:onboarding/v1 | tpl-inst:auto:50000x-bulk-wf-v1-05 | td=2d3d37b60fd32963 | id=2d3d37b60fd32963 | match=true

Template digest == instance digest, as predicted by [[feedback-manifest-digest-keyed-on-piece-graph]].

Actor-scoped rollback dry_run (addressability proof)

SELECT fn_iu_auto_instantiate_rollback_by_actor('iu-core-50000x-bulk', TRUE);

Returns:

status                            = dry_run
target_instance_ids               = [20 uuids]
would_delete_instance_collections = 20
would_delete_lineage_rows         = 20
would_delete_log_rows             = 20

Post-dry counts UNCHANGED (lineage=37, auto_log=33, bulk=20).

What this PROVES

  1. The orchestrator scales linearly under a single TX up to N=20 with zero digest drift.
  2. The bulk-mechanism-is-the-loop pattern holds for productized event-driven composition at this N.
  3. The actor-scope rollback makes a bulk scaleout fully addressable in one call.
  4. The digest_matches_template invariant holds across mixed kind (file + workflow) and mixed version (v1 + v2) batches.

What this does NOT prove

  • N>20.
  • Envelope auto-refresh on these inserts (Phase D blocked).
  • External delivery (Phase F proves it is by-construction blocked).
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-50000x-autoscope-refresh-scaleout-event-ops-closeout-open-goal/03-p2-scaleout-n20.md