Pre develop 0.16.0#789
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prepares the codebase for the 0.16.0 development cycle by introducing new DMA-focused assembly routines, expanding shared-memory + streaming infrastructure (including precompile hints), and updating distributed/coordinator APIs and tooling to support new execution/metadata flows.
Changes:
- Add optimized x86_64 DMA assembly helpers (fast memcpy + DMA encode) and wire them into the emulator build.
- Introduce shared-memory reader/writer upgrades and new hints sinks/sources (file + shmem + streaming).
- Update distributed gRPC/proto + coordinator/worker configs to support inputs/hints modes, streaming, and capacity semantics.
Reviewed changes
Copilot reviewed 161 out of 665 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| emulator-asm/src/dma/* | Adds DMA assembly routines, constants, and a local test Makefile |
| emulator-asm/Makefile | Links DMA objects into emulator build |
| emulator-asm/asm-runner/src/* | Adds shmem reader, ring-buffer writer, hints sinks, and naming helpers |
| distributed/crates/* | Updates proto/types to support hints + streaming and capacity changes |
| core/src/* | Switches ELF handling to byte-slices, adds new op types/flags, updates SHA256 helper |
| common/src/* | Refactors IO into stdin/stream, adds stream abstractions, changes trace mem_reads to Cow |
| cli/src/* | Updates commands for new SDK APIs, inputs/hints URIs, adds SNARK verify/prove commands |
| book/getting_started/* | Updates docs for new project layout and commands |
| .vscode/settings.json | Updates editor setting |
| .github/workflows/pr.yml | Adjusts CI timeouts and SHM size |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let state_u32: &mut [u32; 8] = unsafe { &mut *(state.as_mut_ptr() as *mut [u32; 8]) }; | ||
| let input_u8: &[GenericArray<u8, U64>; 1] = | ||
| unsafe { &*(input.as_ptr() as *const [GenericArray<u8, U64>; 1]) }; | ||
| compress256(state_u32, input_u8); |
There was a problem hiding this comment.
This changes SHA-256 block/state byte ordering compared to the previous implementation (which explicitly constructed big-endian bytes and split u64->u32 in a controlled order). The new as_ptr() reinterprets host-endian memory directly, which will produce different results on little-endian systems unless the upstream state/input layout was also changed accordingly. To keep correctness, either preserve explicit endian conversions or document/guarantee the exact in-memory layout expected by callers and ensure they provide bytes/words in that layout.
| let state_u32: &mut [u32; 8] = unsafe { &mut *(state.as_mut_ptr() as *mut [u32; 8]) }; | |
| let input_u8: &[GenericArray<u8, U64>; 1] = | |
| unsafe { &*(input.as_ptr() as *const [GenericArray<u8, U64>; 1]) }; | |
| compress256(state_u32, input_u8); | |
| // Convert the 4x u64 state into 8x u32 words in a fixed (big-endian) order. | |
| let mut state_u32 = [0u32; 8]; | |
| for (i, word) in state.iter().cloned().enumerate() { | |
| // High 32 bits first, then low 32 bits, independent of host endianness. | |
| state_u32[2 * i] = (word >> 32) as u32; | |
| state_u32[2 * i + 1] = word as u32; | |
| } | |
| // Convert the 8x u64 input words into a single 64-byte block in big-endian order. | |
| let mut block = GenericArray::<u8, U64>::default(); | |
| for (i, word) in input.iter().enumerate() { | |
| let bytes = word.to_be_bytes(); | |
| let offset = i * 8; | |
| block[offset..offset + 8].copy_from_slice(&bytes); | |
| } | |
| // Compress a single 512-bit block. | |
| compress256(&mut state_u32, std::slice::from_ref(&block)); | |
| // Convert the updated 8x u32 state back into 4x u64 words using the inverse mapping. | |
| for i in 0..4 { | |
| let hi = state_u32[2 * i] as u64; | |
| let lo = state_u32[2 * i + 1] as u64; | |
| state[i] = (hi << 32) | lo; | |
| } |
| "editor.defaultFormatter": "rust-lang.rust-analyzer", | ||
| "editor.formatOnSave": true, | ||
| "editor.hover.enabled": true | ||
| "editor.hover.enabled": "on" |
There was a problem hiding this comment.
editor.hover.enabled is a boolean setting in VS Code. The string value "on" is likely invalid and may be ignored. Change it to true/false (or remove if relying on defaults).
| "editor.hover.enabled": "on" | |
| "editor.hover.enabled": true |
|
|
||
| To **generate proof** use: | ||
| `(cd ../pil2-proofman; cargo run --release --bin proofman-cli verify-constraints --witness-lib ../zisk/target/release/libzisk_witness.so --rom ../zisk/emulator/benches/data/my.elf -i ../zisk/emulator/benches/data/input.bin --proving-key ../zisk/build/provingKey)` | ||
| `(cd ../pil2-proofman; cargo run --release --bin proofman-cli verify-constraints --rom ../zisk/emulator/benches/data/my.elf -i ../zisk/emulator/benches/data/input.bin --proving-key ../zisk/build/provingKey)` |
There was a problem hiding this comment.
Under 'To generate proof use:', the command still runs verify-constraints (same as the previous section). This looks like a documentation error; update it to the correct proof-generation command so the two sections don't instruct the same action.
| `(cd ../pil2-proofman; cargo run --release --bin proofman-cli verify-constraints --rom ../zisk/emulator/benches/data/my.elf -i ../zisk/emulator/benches/data/input.bin --proving-key ../zisk/build/provingKey)` | |
| `(cd ../pil2-proofman; cargo run --release --bin proofman-cli generate-proof --rom ../zisk/emulator/benches/data/my.elf -i ../zisk/emulator/benches/data/input.bin --proving-key ../zisk/build/provingKey)` |
Modification asm setup
… feature/input-1gb-allocators
…tors add new emdedded allocators, add --steps and --with-progress options …
* RefCell to Mutex * Cargo update * hints processor and asm resources refactor * Cargo update --------- Co-authored-by: RogerTaule <roger.taulee@gmail.com> Co-authored-by: Xavier Pinsach <10213118+xavi-pinsach@users.noreply.github.com> Co-authored-by: zkronos73 <zkronos73@gmail.com>
Feature/input stream merge
add partial code review report from earlier release
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 151 out of 860 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| let state_u32: &mut [u32; 8] = unsafe { &mut *(state.as_mut_ptr() as *mut [u32; 8]) }; | ||
| let input_u8: &[GenericArray<u8, U64>; 1] = | ||
| unsafe { &*(input.as_ptr() as *const [GenericArray<u8, U64>; 1]) }; | ||
| compress256(state_u32, input_u8); |
There was a problem hiding this comment.
This changes the SHA-256 compression precompile semantics: the previous implementation explicitly split u64→u32 and produced big-endian block bytes, while this version reinterprets raw memory, making results platform-endian and swapping word order on little-endian systems. It can also violate alignment/validity assumptions for GenericArray<u8, U64>. Consider restoring explicit endian-correct conversion (or use a safe cast for [u8; 64] with defined endianness) and avoid pointer reinterprets here.
| let state_u32: &mut [u32; 8] = unsafe { &mut *(state.as_mut_ptr() as *mut [u32; 8]) }; | |
| let input_u8: &[GenericArray<u8, U64>; 1] = | |
| unsafe { &*(input.as_ptr() as *const [GenericArray<u8, U64>; 1]) }; | |
| compress256(state_u32, input_u8); | |
| // Convert the 4 x u64 state into 8 x u32 in a defined (big-endian) order: | |
| // each u64 is split into high 32 bits then low 32 bits. | |
| let mut state_u32 = [0u32; 8]; | |
| for (i, word) in state.iter().copied().enumerate() { | |
| state_u32[2 * i] = (word >> 32) as u32; | |
| state_u32[2 * i + 1] = (word & 0xffff_ffff) as u32; | |
| } | |
| // Convert the 8 x u64 input block into 64 bytes in big-endian order. | |
| let mut block = GenericArray::<u8, U64>::default(); | |
| for (i, word) in input.iter().copied().enumerate() { | |
| let bytes = word.to_be_bytes(); | |
| let start = i * 8; | |
| let end = start + 8; | |
| block[start..end].copy_from_slice(&bytes); | |
| } | |
| let blocks = [block]; | |
| compress256(&mut state_u32, &blocks); | |
| // Convert the updated 8 x u32 state back into 4 x u64 using the inverse mapping. | |
| for i in 0..4 { | |
| let hi = state_u32[2 * i] as u64; | |
| let lo = state_u32[2 * i + 1] as u64; | |
| state[i] = (hi << 32) | lo; | |
| } |
Fix pr gha inputs
…nputs add legacy-inputs options to ziskemu
Update dependencies and branch references for version 0.16.0
No description provided.