Skip to content

std/extdeps: dissolve .length() nickname -> canonical .count() (seed closure) - #5395

Closed
gunbai-bot[bot] wants to merge 1 commit into
mainfrom
emitter/length-count-dissolution
Closed

gunbai-bot[bot] wants to merge 1 commit into
mainfrom
emitter/length-count-dissolution

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

What

Dissolves the .length() → .count() §3 nickname in the 2 files in the v1 seed closure: dsl/extdeps/version/semver.dag (8 sites) + dsl/std/realization_schedule.dag (13 sites) = 21 sites, all List receivers.

Why

.length() is a nickname for sequence cardinality. The canonical op is count — the only one in the compiler method table (04_method.dag) and the only one that gets descent/termination inference (classify_size_expr in 04_infer.dag). .length() falls through the compiler's unknown-method path and emits a call to a nonexistent v1_rt::length, breaking the v1 seed (E0425, ~19 sites). .count() emits the valid host .len() as i64 for List receivers.

Verification (authoritative, not proxy)

This is a source change and count is an existing builtin, so one regen with main's bin takes effect (no two-stage bootstrap). Control vs treatment on the same main base:

class control (no change) with dissolution
E0425 36 17 (−19, exactly the v1_rt::length cluster)
all others — identical

v1_rt::length occurrences in the regenerated seed: 0. Zero new error classes (E0433 = 6 in both — pre-existing on current main, not introduced).

Scope / guardrail

Only the seed-closure files. The remaining corpus .length() sites (pep440, yaml, cache_interface, compute_fabric, workflow_yaml) are outside the seed and land with the separate unknown-method fail-closed hardening work-item (which also needs the count-on-String host realization, since String = FreeMonoid<Char>). Every dissolved site was confirmed a pure List count-nickname (guardrail: any non-count-semantics site would have been escalated, none were).

.dag-only — committed seed unchanged, main keeps building. emitter-completeness slice, NOT seed-green; seed-green lands in #5325.

🤖 Generated with Claude Code

`.length()` is a §3 nickname for the cardinality of a sequence; the canonical
op is `count` (the only one in the compiler method table — 04_method.dag — and
the only one that gets descent/termination inference via classify_size_expr).
`.length()` falls through the compiler's unknown-method path and emits a call to
a nonexistent `v1_rt::length`, which breaks the v1 seed (E0425). Dissolve it to
`.count()`, which emits the valid host `.len() as i64` for List receivers.

Scope: the two files in the v1 seed closure (the only seed .rs that emit
v1_rt::length): extdeps/version/semver.dag (8) + std/realization_schedule.dag
(13) = 21 sites, ALL List receivers (semantics-preserving count-nickname; no
String receivers in scope). The remaining corpus .length() sites (pep440, yaml,
cache_interface, compute_fabric, workflow_yaml) are outside the seed closure and
land with the separate unknown-method fail-closed hardening work-item (which
also needs the count-on-String host realization).

Verified by execution (authoritative, not proxy — source change, count is an
existing builtin so one regen takes effect): control vs treatment on the same
main base — E0425 36 -> 17 (exactly -19, the v1_rt::length cluster), every other
error class identical, zero regressions. v1_rt::length count in the seed: 0.

emitter-completeness slice, NOT seed-green; seed-green lands in #5325.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor

Consolidated into #5413 (freeze consolidation of the durable gunbc lanes). Branch retained; reopen if the consolidation is unwound.

@briansrls briansrls closed this Jun 20, 2026
briansrls added a commit that referenced this pull request Jun 20, 2026
…) (#5413)

Consolidates the durable freeze lanes onto one branch (each constituent closed in favor of this):
- #5402 dsl_compile_clean dual-root gate-widen (Strategy A keystone)
- #5395 .length() -> .count() dissolution
- #5407 anemia CONFIRM eval corpus (additive)
- #5400 phantom type-tag derives
- #5396 Measure-alias count peel (E0560)

Plus a carried fix for a pre-existing main defect (from #5406): clippy::manual_is_multiple_of +
fmt in v2_whole_tree_parse_scan.rs (main's rust_monolith gate is skipped on main pushes, so it
went uncaught; this is the first post-#5406 PR to touch a .rs and run clippy against it).

Local receipt: cargo fmt --all --check clean; cargo clippy --all-targets -- -D warnings exit 0;
cargo test -p v1-compiler-tests interp_recorded_fixture/wet_hermetic/resolve_expr_types_retraversal
= 28 passed, 0 failed. All other floor gates (dsl_compile_clean, source_root_ingest, emit_host,
layering, 557-witness corpus) were green on the prior runs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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