Issue #2088: Unobservable std tests: the Rust tests no program or test block can reach

Open and answer this issue on GitHub.

blocked, bugs · opened 2026-11-18 · updated 2026-11-19 · 14 comments

Filed by the driver from the Found: of the run of issue-2082 (#2082) (owner, 2026-11-06). Title shortened by the supervisor (2026-11-19); the driver had set the Found line as the title.

Decided (supervisor, 2026-11-19, by the owner’s direction of 2026-11-18)

Waits for #2233 and the open sub-issues.

Found (the driver’s original list)

no program or test block can reach these Rust tests, so they stay #[test]: build_time.rs (needs a step budget below the 10^10 default, comptime_run::Bounds, which no program sets); rt/exit.rs (the LEAVING flag of the at-exit allocator); rt/library.rs (thread reuse for C library _async calls, needs a C caller); either_text.rs (is_view is not observable); rt/worker.rs (I/O workers and the drain deadline); concat.rs tests 2-3 (buffer pointer reuse, as_ptr); count.rs test 3 (of("text") passes through, no emitter site writes count::of around text)

Done when

Every sub-issue is closed, no #[test] is left in crates/nikaia-std, and #2082 can set test = false.

Comments

keywan-ghadami, 2026-11-18

Decision paper (supervisor, 2026-11-18): the question goes to the owner

Question. Some hand-written #[test]s in nikaia-std check runtime internals that no Nikaia program and no test block can observe. What happens to them, so that test = false (the Decision of “The std crate’s Rust unit tests move into Nikaia, so nikaia-std has no cfg(test) build”, #2082) can hold?

Affected so far (from the run of #2082; about 236 tests in 28 files are not probed yet, so the list may grow):

Options

Recommendation: a). It is the only option that keeps both the coverage and the single compile. Before a test goes into the hook, the run checks whether a program does reach it after all. For example, build_time.rs could be reached if a budget can be set.

Until the owner decides, #2082 continues with the 28 files not yet probed. Tests found unreachable stay #[test]; step 4 (test = false) waits for this decision.


Generated by Claude Code

keywan-ghadami, 2026-11-18

More cases from the #2082 run of 2026-11-18 (2f613638). The driver filed them as their own issues (#2104, #2105, #2106); they are closed as duplicates of this one, and the decision here covers them:


Generated by Claude Code

keywan-ghadami, 2026-11-18

From the report of the run of issue-2082 (#2082):

kept as Rust because no program reaches them (#2082 run): num to_usize/to_isize; map a_text_key_hashes_as_its_text, the_order_is_hashbrowns, colliding_keys_are_told_apart and entries_drain_and_retain (HashMap remove/retain missing); bytes a_clone_shares_the_buffer, a_vec_is_handed_over (buffer address), a_copy_is_asked_for (to_vec/collect not in Bytes’s contracts); html text_that_needs_nothing_is_returned_unallocated, escaped_text_becomes_markup (Raw::escaped not in contracts); hash’s 8 FxHasher tests


Generated by Claude Code

keywan-ghadami, 2026-11-18

Decided (owner, 2026-11-18) for concat.rs’s “an owned left side keeps its buffer” and “a borrowed left side reuses the right”: a test compares mem::allocations() (and mem::usage()) before and after the operation; no address of a value is readable. Recorded in ADR-400 (91361407); the build is “std::mem: allocations() and usage() per thread (ADR-400)” (#2112), which also moves the two tests. Raw addresses and writing through them with unsafe stay a later question for std::backend::<arch>.


Generated by Claude Code

keywan-ghadami, 2026-11-18

Supervisor, 2026-11-18: four more items sorted; none needs a new tool.

Left for a decision: rt/library.rs (thread reuse for a C caller’s _async calls) and rt/worker.rs (the drain deadline).


Generated by Claude Code

keywan-ghadami, 2026-11-18

supervision.rs, the two Backoff tests: no new tool is needed. The owner decided on 2026-11-18 to move Backoff into Nikaia as supervisor::Backoff(); a program then calls its decide directly. Filed as “std’s default restart policy supervisor::Backoff() is written in Nikaia, its tests too” (#2118).


Generated by Claude Code

keywan-ghadami, 2026-11-18

Decided (owner, 2026-11-18) for process.rs names_compare_without_case_on_windows: no new tool. The environment assembly moves into Nikaia with a windows input and a Nikaia test calls it directly with Windows = yes: “Child environment assembly in Nikaia, Windows case tested directly” (#2119).


Generated by Claude Code

keywan-ghadami, 2026-11-18

Owner, 2026-11-18, for every remaining test of this issue: a branch no program reaches is moved into a pure Nikaia function with the deciding condition as an input, and a Nikaia test calls it directly. Where that is not enough, the owner proposes to consider again a way to call std’s Rust from Nikaia; such a case comes back to the owner first.


Generated by Claude Code

keywan-ghadami, 2026-11-18

Decided (owner, 2026-11-18) for rt/worker.rs (the drain deadline): no new tool. A Nikaia test runs a child program whose I/O worker does not finish before the drain deadline and pins what the runtime does then: exit code 70 and its message on stderr. The Rust test goes once that test passes.


Generated by Claude Code

keywan-ghadami, 2026-11-19

From the report of the run of issue-2188 (#2188):

Two layout tests in crates/nikaia-std/src/error.rs stay Rust, marked “Kept as Rust (#2082)”: a_result_around_an_envelope_is_as_small_as_around_the_bare_error (size_of of Result/Thrown/Site/Raised) and a_site_alone_is_the_tagged_word (a site alone is the tagged word, no cold box). No program sees them and no test block can name size_of. This is a gap with no decision yet (from #2188).


Generated by Claude Code

keywan-ghadami, 2026-11-19

From the report of the run of issue-2189 (#2189):

lock.rs keeps update_appends_without_copying_the_value and access_reads_a_large_value_in_place under a comment that points here (961bd9b6): they check that a door does not copy, by the buffer’s address, which no program can observe


Generated by Claude Code

keywan-ghadami, 2026-11-19

From the report of the run of issue-2196 (#2196):

Gap, no decision yet: two layout tests of crates/nikaia-std/src/error.rs stay Rust (#2196). They are a_result_around_an_envelope_is_as_small_as_around_the_bare_error (size_of of Result/Thrown/Site/Raised) and a_site_alone_is_the_tagged_word (a site alone lives in the tagged word, no cold box). No program can see either, and no test block can name size_of.


Generated by Claude Code

keywan-ghadami, 2026-11-19

From the report of the run of issue-2215 (#2215):

Gaps left by #2215 (each kept as Rust with a “Kept as Rust (#2082)” comment): abort.rs an_unknown_line_is_not_guessed_at (the emitter maps only lines it writes, no program reaches an unknown one); num.rs a_usize_and_an_isize_convert_toward_zero_or_stop (Part I 2.2 has no usize); concat.rs a_borrowed_left_side_reuses_the_right (no program’s text reaches Plus for &str: a right side std builds becomes block::Text first); html.rs escaped_text_becomes_markup (Raw::escaped is not in the contracts); process.rs names_compare_without_case_on_windows (Windows only); supervision.rs the_default_policy_grows_and_gives_up (delays are time; the default gives up after 300 s); supervision.rs a_healthy_run_starts_a_new_cycle (60 s of uptime); map.rs a_text_key_hashes_as_its_text (the hasher a key goes through is not observable); map.rs colliding_keys_are_told_apart (a program cannot give a map its own hasher); map.rs entries_drain_and_retain (collections::HashMap lacks remove and retain); map.rs the_order_is_hashbrowns (no program can build hashbrown's map to compare).


Generated by Claude Code

keywan-ghadami, 2026-11-19

“A package’s Nikaia code and test blocks call the package’s own Rust” (#2233) is built and pushed (0.0.1468). The 24 std tests that were kept as Rust now move through that bridge in “std’s tests kept as Rust become test blocks that call std’s own Rust through the bridge” (#2304). The rt/exec.rs test moves in #2209, which waits for #2208. All of them are queued in the CI lane. This issue stays blocked until they are done.


Generated by Claude Code

Back to Open Issues