code wiki / _hdl_build / nx_ale_parallel.nx

nx_ale_parallel.nx

buildroot/runtime/_hdl_build/nx_ale_parallel.nx

9351 B203 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic ale
docsdependenciesstructsconstsfunctions

about

nx_ale_parallel.nx -- ALE PRACTICE: straightforward PARALLEL task consumption. The single-task consumer is the harness (nx_ale_harness <task> <sb> <out> <score>); THIS consumes a whole manifest CONCURRENTLY -- it forks one harness per task ALL AT ONCE (phase 1), then waits for every child (phase 2), then reads + classifies the scores (phase 3). So N tasks are attempted in parallel (wall-clock ~ the slowest single task, not the sum), which is how the team PRACTICES at scale + how the LLM integration throws many tasks at the agent and collects scores. Parallel by construction; correctness == the sequential suite (proven in the self-gate). Reuses the harness (DRY). Each task gets its own sandbox/outdir/scorefile so concurrent attempts never collide. args mode: nx_ale_parallel <manifest> -> consume in parallel; print per-task + elapsed_ms. no-arg: SELF-GATE -- parallel-consume the seed suite (all SOLVED == sequential) + a known-GAP task (classified GAP) -> PARALLELGATE verdict=GREEN to knowledge/status/ale_parallel.log. Landmines: nested ifs (no &&/||), flat exprs, <=6 args/func, no empty-string literal. license_tier: ORIGINAL module: nishi-core.ale.parallel depends: nishi-core.sys.syscalls capability: ALE_PARALLEL_CONSUME

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_ale_parallel.nx

imports: nx_syscalls.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 sys_now_ms sys_mmap ↻ sys_clock_gettime_mono pr_p sys_write pr_consume sys_mmap ↻ pr_read sys_openat_rd sys_read sys_close pr_idx_path sys_mmap ↻ sys_mkdir pr_unlink pr_fork sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve sys_exit sys_wait4 pr_score_of sys_mmap ↻ pr_read ↻ pr_p ↻ pr_fn sys_mmap ↻ sys_write ↻ pr_fn ↻ sys_exit ↻ pr_write_file pr_unlink ↻ sys_openat_wr ↻ sys_write ↻ pr_len sys_close ↻

structs

none

consts

18const PAR_MAGIC_65536: i64 = 65536
19const PAR_MAGIC_2048: i64 = 2048
20const PAR_MAGIC_2047: i64 = 2047
22const PAR_MAX: i64 = 256

functions

24func pr_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: pr_consumemain calls 1: sys_write
25func pr_fp(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
26func pr_fn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m; sys_write(fd, "-" as *u8, 1) }; let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48; k = 1 }; while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }; var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 }; sys_write(fd, bb, k); return 0 }
called by 2: pr_consumemain calls 2: sys_mmapsys_write
27func pr_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: pr_write_file
30func pr_read(path: *u8, buf: *u8, cap: i64) -> i64
45func pr_score_of(path: *u8) -> i64
called by 1: pr_consume calls 2: sys_mmappr_read
55func pr_write_file(path: *u8, s: *u8) -> i64
64func pr_idx_path(dst: *u8, prefix: *u8, idx: i64) -> i64
called by 1: pr_consume calls 1: sys_mmap
80func pr_fork(task: *u8, sb: *u8, out: *u8, score: *u8) -> i64
101func pr_consume(manifestpath: *u8, res: *i64, verbose: i64) -> i64
162func main(argc: i64, argv: *i64) -> i64