Sample
once_cell 1.21.4: Distinguish non-blocking race initialization from blocking sync initialization in once_cell, proving that race::OnceBox executes all concurrent closures and drops loser allocations, permits re-entrancy without deadlocking, and does not poison on panics
Verified sample for cargo once_cell 1.21.4: Distinguish non-blocking race initialization from blocking sync initialization in once_cell, proving that…
sha256:bf34c4b96e5d2e5c6749e27e05216e4f465933461e70adea2f1b2170b3c1b021
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 2
- Signing keys that built it
- 2
Declared environment
rust linux x64 rust rust cargo
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1 |
2026-08-16 |
| rust 1 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1 |
2026-08-18 |
Case
HOW- Goal
- Distinguish non-blocking race initialization from blocking sync initialization in once_cell, proving that race::OnceBox executes all concurrent closures and drops loser allocations, permits re-entrancy without deadlocking, and does not poison on panics
- Packages
- Symbols
-
- once_cell::race::OnceBox
- once_cell::race::OnceBox::get_or_init
- once_cell::race::OnceBox::set
- once_cell::race::OnceBox::clone
- once_cell::race::OnceNonZeroUsize
- once_cell::race::OnceBool
- once_cell::race::OnceRef
- once_cell::sync::OnceCell
- once_cell::sync::OnceCell::get_or_init
- once_cell::sync::OnceCell::set
- once_cell::sync::OnceCell::try_insert
- once_cell::unsync::OnceCell
- once_cell::unsync::OnceCell::get_or_init
- Environment
- rust
- Created
- 2026-08-16T08:11:04Z
Contract
- assert race::OnceBox executes all 16 contending closures concurrently while immediately dropping all 15 losing heap allocations and storing exactly one winner
- assert sync::OnceCell blocks contending threads and executes its initialization closure exactly once across all 16 threads
- assert race::OnceBox allows re-entrant initialization where inner init wins and outer value is discarded, whereas unsync::OnceCell panics with 'reentrant init' and sync::OnceCell deadlocks
- assert panics during get_or_init do not poison sync::OnceCell or race::OnceBox, leaving them uninitialized and available for subsequent successful initialization
- assert sync::OnceCell::set returns Err(T), sync::OnceCell::try_insert returns Err((&T, T)), race::OnceBox::set returns Err(Box<T>), and race::OnceNonZeroUsize/OnceBool return Err(()) on collision
- assert race::OnceBox::clone on an initialized cell deep-clones into an independent heap allocation, while an uninitialized clone remains empty
- assert race::OnceRef stores borrowed references without heap allocation and rejects subsequent writes with Err(())
Files
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs