code wiki / (root) / nx_dual_companion_compose_test.nx

nx_dual_companion_compose_test.nx

buildroot/runtime/nx_dual_companion_compose_test.nx

8624 B200 linesdepth 6pulls 15 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_dual_companion_compose_test.nx -- two-actor concurrent inference proof. The parallel-companion north star concretized: NARRATOR + NPC actors running interleaved cooperative steps, each generating 3 tokens autoregressively, output ordered through one multiplexer. What this proves end-to-end: 1. Two independent LLM-actor contexts can share the same scheduler + message bus + multiplexer without state corruption. 2. Cooperative pick_next interleaves them by priority + fairness. 3. nx_lr_actor_reset_for_next_token lets each actor roll into the next token using its own previous output (autoregressive loop). 4. Multiplexer correctly orders concurrent tokens by stream class priority (NARRATOR LLM_TEXT > NPC LLM_TEXT same class, FIFO tie-break + arrival-time tracking). 5. The other-agent's embedding + matmul + sample primitives are invoked 12 times (6 tokens x 2 actors x 3 primitive calls each) without leak / overflow / state cross-contamination. This is the smallest substrate-honest demonstration of the [[feedback-parallel-companion-multimodal-dnd-real-time]] cardinal.

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_tensor.nx nx_actor.nx nx_message.nx nx_stream_multiplexer.nx nx_actor_role_llm.nx nx_dual_companion_compose_test

imports: nx_syscalls.nxnx_tier.nxnx_tensor.nxnx_actor.nxnx_message.nxnx_stream_multiplexer.nxnx_actor_role_llm.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_t_alloc nx_dt_is_valid nx_dt_element_bytes sys_mmap ↻ nx_t_compute_strides_rowma _fill_q10 nx_ac_sched_new sys_mmap ↻ nx_ms_bus_new sys_mmap ↻ nx_sm_new sys_mmap ↻ nx_ac_spawn nx_ms_register sys_mmap ↻ nx_ms_subscribe nx_ms_kind_is_valid nx_lr_actor_new sys_mmap ↻ nx_t_alloc ↻ nx_prng_init nx_lr_actor_step _lr_step_embed sys_mmap ↻ nx_embedding_lookup nx_t_is_contiguous _lr_step_proj nx_blas_matmul nx_blas_gemm _blas_check_matmul nx_t_is_contiguous ↻ _lr_step_sample nx_logit_apply_temperature nx_logit_top_k_mask sys_mmap ↻ nx_sample_categorical nx_prng_range nx_prng_next

structs

none

consts

none

functions

33func _fill_q10(t: *NxTensor, base: i64, stride: i64) -> i64
called by 1: main
43func main() -> i64