Repository navigation
fix(hy-check): track generic structs, prelude set[T], and associated generic calls (#105) - #106
sonson0910 wants to merge 1 commit into
Conversation
d3c3f15 to
4ec24cb
Compare
|
Triage (2026-10-15, AI maintainer): generic struct instantiations + prelude set[T] (#105) is the largest remaining known soundness gap and your writeup is the most complete we have. This one is genuinely big — it gets its own review slot rather than the conveyor: expect a design note from the maintainer side first (the shape machinery's generic-story is uncommitted today), then a maintainer-assisted rebase. Thank you for the depth here. |
4ec24cb to
0f85670
Compare
|
Thank you for the kind words and dedicated review slot! Proactively rebased |
|
Triage (2026-10-15, AI maintainer, post-CI-repair): unchanged from last session: generic struct instantiations + prelude set[T] (issue #105) keeps its own design-note-first review slot — the maintainer-side shape-machinery note is due with the next review pass. Queued as its own slot, not the conveyor. |
417b144 to
6825571
Compare
|
Wave-2 triage: queued — next tier (carried from wave 1). Fixes #105 (generic structs box[T]/lru_cache, prelude set[T], associated generic calls) — the largest single soundness surface left; lands after a fresh rebase. |
6825571 to
ed47037
Compare
599613b to
c910c58
Compare
ac8fa92 to
61d6a1c
Compare
61d6a1c to
5ea48d1
Compare
5ea48d1 to
3320310
Compare
3320310 to
c127754
Compare
Fixes #105 (Bounty Track #5).
Summary
Closes the generic and prelude type-table omissions in
hy-checkthat allowed mutable reference-bearing state to cross task boundaries un-frozen (A1b) or un-classified (A1c):box[map[string]int],lru_cache[string, int]):build_tables(lib.rs) recordsstruct_type_params: HashMap<String, Vec<TypeParam>>alongsideself.structs.shape.rsaddssplit_generic_nameandresolved_struct_fields, substituting type arguments across generic struct fields inshape_may_share_at,field_shape, andstruct_has_mutex_field.b2 := b1) of generic structs instantiated with reference-bearing type arguments now record amay_shareedge and are frozen onmove b1(HYB-E3003), while field projections (m := b1.v) resolve to their substitutedTypeShape. Generic structs instantiated with purely sendable types (box[int]) remain non-sharing.set[T](set.new[string]()):hy-emitlowersset[T]totype set[t comparable] struct { m map[t]struct{} }, so a shallow struct copy shares the underlying Go mapm.shape.rsrecognizesset/set[T]innamed_shape_at,call_shape(set.new[T](),.insert/.contains/.len), andshape_may_share_at(true).lru_cache.new[string, int](2),box.new[map[string]int](m)):shape.rsaddsresolve_hy_fn_callto resolve direct andType.methodassociated Hybrid function calls (with explicit[type_args]or argument-inferred type parameters) acrosscall_shape,ty_of_expr,multi_value_shapes, andmulti_value_tys(plussendability.rsandloans.rs), alongsideDecl::TypeAliasresolution and call-returnmay_sharepropagation.Verification
compiler/crates/hy-check/src/lib.rs:set_prelude_shallow_copy_and_unmoved_spawn_rejectgeneric_struct_instantiation_tracks_may_share_and_field_projectiongeneric_and_associated_fn_calls_preserve_return_shape_and_arg_sharingtype_alias_resolves_underlying_shape_for_aliases_and_boundariescargo test --workspace— all unit and integration tests pass.cargo clippy --workspace --all-targets -- -D warnings— 0 warnings.python3 tools/corpus_harness.py—27/27verdict agreement, tripwire not fired.python3 tools/managed_gate.py—PASS (2 block(s), baseline 2).python3 tools/differential_loop.py—10/10accept,17/17reject (FULL AGREEMENT).examples/*/program.hypasshyb checkwith0 diagnostics.