code wiki / _hdl_build / nx_ale_parallel.nx
nx_ale_parallel.nx
buildroot/runtime/_hdl_build/nx_ale_parallel.nx
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
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
structs
| none |
consts
| 18 | const PAR_MAGIC_65536: i64 = 65536 |
| 19 | const PAR_MAGIC_2048: i64 = 2048 |
| 20 | const PAR_MAGIC_2047: i64 = 2047 |
| 22 | const PAR_MAX: i64 = 256 |
functions
| 24 | func 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 } |
| 25 | func 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 } |
| 26 | func 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 } |
| 27 | func 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 |
| 28 | func pr_unlink(path: *u8) -> i64 { return __syscall(263, AT_FDCWD, path, 0, 0, 0, 0) } |
| 30 | func pr_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 45 | func pr_score_of(path: *u8) -> i64 |
| 55 | func pr_write_file(path: *u8, s: *u8) -> i64 |
| 64 | func pr_idx_path(dst: *u8, prefix: *u8, idx: i64) -> i64 |
| 80 | func pr_fork(task: *u8, sb: *u8, out: *u8, score: *u8) -> i64 |
| 101 | func pr_consume(manifestpath: *u8, res: *i64, verbose: i64) -> i64 |
| 162 | func main(argc: i64, argv: *i64) -> i64 |