Repository navigation
fix(hy-check): treat atomic.pointer[T] and atomic.value as unproven per GUARANTEES row 11 (HYB-E3005) - #52
Merged
limitlessprojects merged 1 commit intoOct 14, 2026
Conversation
…er GUARANTEES row 11 (HYB-E3005)
ocakciomursel-pixel
force-pushed
the
fix/atomic-pointer-unproven
branch
from
October 14, 2026 18:48
06a90ae to
bc99907
Compare
This was referenced Oct 18, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #51
Participation in #5
Problem
GUARANTEES.mdrow 11 specifies thatsync/atomic(atomic.Pointer[T],atomic.Value) is[TBD]untilTsendability and linearstore/swapdiscipline are defined, and states verbatim: "Until then: unproven -> rejected."Currently,
foreign_named_typeincompiler/crates/hy-check/src/foreign.rsmaps everyatomic.*type (name.starts_with("atomic.")) to Class-2TypeShape::Atomic(sendable across task and channel boundaries), andmethod_resultreturnsSome(TypeShape::Primitive)for everyatomic.*method call (p.load(), etc.). This allows&p(*atomic.pointer[holder]whereholderwraps amap[string]int) or&v(*atomic.value) to crosstaskboundaries with0 diagnostics(OK) and race on the shared map at runtime (fatal error: concurrent map writes).Fix
compiler/crates/hy-check/src/foreign.rs:TypeShape::Atomicinforeign_named_typeandmethod_resultto the scalar atomic types (atomic.int32,atomic.int64,atomic.uint32,atomic.uint64,atomic.uintptr,atomic.bool).is_unproven_atomic(name)soatomic.pointer[...]andatomic.valueresolve toTypeShape::Unknown(fail-closed per O4.9 /GUARANTEES.mdrow 11).compiler/crates/hy-check/src/sendability.rs:atomic.pointer[T]/atomic.value), emitHYB-E3005(tier0_rule: "FC") with a specific note citingGUARANTEES.mdrow 11 and teaching the safe alternatives (channel, mutex-guarded type, ormanaged("...", "atomic")hatch).compiler/crates/hy-check/src/lib.rs:fc_atomic_pointer_and_value_reject_e3005_row_11verifying bothatomic.pointer[holder]andatomic.valuereject withHYB-E3005while scalaratomic.int64(atomic_and_const_immutable_spawn_args_accept) remains accepted.Verification
cargo test --workspace: all unit, corpus (20/20), and differential integration tests pass (0failures).cargo clippy --workspace --all-targets -- -D warnings:0warnings.hyb checkon all 10examples/*.hy:10/10pass.Prepared with AI assistance.