code wiki / (root) / nx_clock.nx

nx_clock.nx

buildroot/runtime/nx_clock.nx

2545 B38 linesdepth 2pulls 2 transitivereach 508 importersview sourcekind librarytopic clock
docsdependenciesstructsconstsfunctions

about

nx_clock.nx -- MONOTONIC CLOCK PRIMITIVE for the runtime layer. THE WOUND (found 2026-07-30): nx_clock_monotonic_ns() was CALLED by nx_loop.nx (its watchdog, lines 219/237) and by 8+ other organs, and DEFINED NOWHERE IN THE TREE. Because nx_loop.nx is imported by nx_bpe.nx, which is imported by the whole nx_gguf/nx_f32_llm family, that single missing function darkened 174 organs: every one of them failed to compile, which is why nx_f32_llm_serve.elf had been frozen at Jul 16 and the sovereign LLM capability was unreachable. It presented as -- a diagnostic naming no file, no symbol and no line, which is why it survived so long. The real chain took a five-step bisect to reach: probe imports nx_bpe -> FAILS | nx_f32 -> BUILDS (isolates nx_bpe) nx_bpe's imports: nx_loop -> FAILS, others BUILD (isolates nx_loop) nx_loop's own imports all BUILD (so it is nx_loop's CONTENT) identical content builds in _hdl_build/, fails in runtime/ (so it is RESOLUTION, not syntax) -> runtime/nx_loop.nx imports nx_clock.nx, which existed ONLY in _hdl_build/ ★LAW CONFIRMED THE HARD WAY: runtime/ CANNOT import _hdl_build/. A layering violation does not fail at the violating file -- it fails at every transitive dependent, with a message that names none of them. ⚠TWO MODULES, ONE NAME: _hdl_build/nx_clock.nx is a SCHEDULER (clk_tick/clk_dispatch_run/clk_register). This is NOT that module and must not be confused with it -- resolving the import to the scheduler made imports expand and then failed differently, which is how the real missing symbol finally got named. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 55 importers

nx_syscalls.nx nx_clock.nx _clk_probe.nx _nx_bits_speed_paired.nx _nx_loop_v2_oracle.nx nx_batch_infer.nx nx_bench_collatz.nx nx_bench_companion_timed.nx nx_bench_companion_timed_test.nx nx_bench_dist_emit_test.nx nx_bench_dist_persist_test.nx nx_bench_divpow2.nx

diagram shows first 10 each side; +0 more imports, +45 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: _clk_probe.nx_nx_bits_speed_paired.nx_nx_loop_v2_oracle.nxnx_batch_infer.nxnx_bench_collatz.nxnx_bench_companion_timed.nxnx_bench_companion_timed_test.nxnx_bench_dist_emit_test.nxnx_bench_dist_persist_test.nxnx_bench_divpow2.nxnx_bench_fannkuch.nxnx_bench_fnv.nxnx_bench_hll_throughput.nxnx_bench_hll_vs_datasketches.nxnx_bench_matmul.nxnx_bench_popcount.nxnx_bench_scale_dist_emit_test.nxnx_bench_scale_test.nxnx_bench_spectral.nxnx_bench_stress_autoreg_test.nxnx_bench_stress_emit_test.nxnx_clbg_fannkuch.nxnx_connect_gate.nxnx_daemon_bench.nxnx_daemon_bench_test.nxnx_dot_simd_demo.nxnx_dual_real_llm_compose_test.nxnx_dual_real_llm_emit_test.nxnx_emit_journal.nxnx_external_reach_probe.nxnx_f32_linear_simd.nxnx_f32x8_dot_bench.nxnx_gpu_bench.nxnx_ingest_at_scale.nxnx_lcg_bench.nxnx_linear_attn_bench.nxnx_log_v2_test.nxnx_loop.nxnx_native_micro_bench.nxnx_parallel_simd_reduce.nxnx_perf_bench.nxnx_perf_bench_test.nxnx_progress_watchdog.nxnx_prover_eval.nxnx_q4k_dot_simd.nxnx_q4k_gemm_mt.nxnx_q4k_speed_bench.nxnx_q5k_dot_simd.nxnx_quad_real_emit_test.nxnx_simd_bench.nxnx_simd_dot_bench.nxnx_sum_bench.nxnx_sum_bench_all.nxnx_validation_cycle.nxnx_verify_ingest.nx

structs

none

consts

28const NXCLK_NS_PER_S: i64 = 1000000000

functions

34func nx_clock_monotonic_ns() -> i64