The assembler of a fleet-rendered pathtrace image: each tile's pass sums folded in pass order, exactly once, in the cluster float mode, checked against their digests
$ sexc add @ajax/mesh-assemble- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 05:23v/# 1 version
- drwxr-xr-x-Oct 27 05:23files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 05:23 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-check ^0.1.0, @ajax/mesh-strbuf ^0.1.0, @ajax/mesh-omap ^0.1.0, @ajax/mesh-jobs-id ^0.1.0, @ajax/mesh-jobs-spec ^0.1.0, @ajax/mesh-abi-ops ^0.1.0, @ajax/mesh-ftz ^0.1.0, @ajax/pathtrace-scene ^0.1.0, @ajax/pathtrace-job-scene ^0.1.0, @ajax/pathtrace-view ^0.1.0, @ajax/pathtrace-digest ^0.1.0, @ajax/pathtrace-z ^0.1.0, @ajax/mesh-ref-pathtrace ^0.1.0, @ajax/mesh-ref-sha256d ^0.1.0, @ajax/mesh-assemble-bmp ^0.1.0
- dependents
- @ajax/mesh-blobd, @ajax/mesh-jobd
- keywords
- mesh alphaos pathtrace assembly deterministic
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-assemble
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-assemble 2 3The assembler of a fleet-rendered pathtrace image, sans IO. blobd feeds it the job's committed 4results (each item's blob reference and pass-sum digest) and the blobs' bytes, and asks it what to 5fetch next and for the image. 6 7Item w = pass × tiles + tile is one tile's pass sums, computed from +0 wherever it ran. The image is 8the reference's, bit for bit, because of three rules: 9 10- **In pass order.** Each tile's pass sums are folded `acc = ((0 + P0) + P1) + ..`, every add in the 11 cluster float mode Z. 12- **Exactly once per (tile, pass).** A tile advances only by its next pass. A blob that arrives early 13 waits, and the caller fetches at most `WINDOW` passes ahead. A second copy of a folded pass is 14 dropped. 15- **Checked first.** Every payload is checked against its item's pass-sum digest (the job record's 16 `J_PART`) before it is folded. A wrong one is refused and kept in `bad`. 17 18The 8-bit pixels are re-toned when a tile changes or the job's tone map does, so the image is 19progressive and a tone-map swap never touches the accumulators. The assembler also gives the image's 20digests (as kcheck prints them), raster, PPM, BMP (`@ajax/mesh-assemble-bmp`) and sha256. 21 22## Ported from 23 24[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): 25`crates/mesh-host/src/assemble.rs`: `WINDOW`, `Item`, `part_of`, `job_scene`, `renders`, `Assembly`. 26 27## Tests 28 29`tests/assemble.c`: 30- The Rust's `ordered_fold_is_the_reference_exactly_once`. Five random orders of commits and blobs, 31 with duplicates and early arrivals, fold bit for bit to the CPU reference 32 (`@ajax/mesh-ref-pathtrace`): the accumulators, pixels and digests. A tone-map swap and back keeps 33 the accumulators. A corrupted payload and a short one are refused. 34- `default_reference_digests`: the default scene's shape, `job_scene`'s refusals, `renders`, and 35 `part_of`. 36 37## Licence 38 39MIT. See the repository's LICENSE.