Skip to content

Performance improvements [4]#28

Merged
maximmenshikov merged 8 commits into
masterfrom
feature/perf4
Jun 4, 2026
Merged

Performance improvements [4]#28
maximmenshikov merged 8 commits into
masterfrom
feature/perf4

Conversation

@maximmenshikov

Copy link
Copy Markdown
Collaborator

No description provided.

Bump RuntimeVersionPostfix and BlobsVersion from .b22 to .b23 for the
DotnetVersion 10 variant.

Signed-off-by: Maxim Menshikov <maksim.menshikov@nethermind.io>
Move the bump pointer into a fixed-address linker cell (g_zk_bump_ptr at
0xbffefff8) so JIT-emitted inline allocation can reference it by a hardcoded
constant and share it with the C allocator. Add __wrap_RhpNewFast, a leaf
fixed-size allocator that inlines the downward bump in the same translation unit
as mem and the heap bounds, mirroring how x64/arm64 get a tight RhpNewFast
helper. Rename the unused __wrap___libc_free parameter to avoid shadowing the
mem macro.

Signed-off-by: Maxim Menshikov <maksim.menshikov@nethermind.io>
Remove the malloc-based __wrap_RhpNewFast from rhp/module.c. The wrapper now
lives in pal/module.c, where the downward bump allocator is inlined directly
into it within the same translation unit as the heap bounds, avoiding a nested
malloc call and collapsing to a single alignment step in a leaf function. The
--wrap=RhpNewFast directive in rhp/module_params.yml still redirects callers to
the new location.

Signed-off-by: Maxim Menshikov <maksim.menshikov@nethermind.io>
Reserve the top 8 bytes of RAM as a fixed-address cell (g_zk_bump_ptr) holding
the downward bump pointer, so the JIT can hardcode its address via lui/addi
without relocation and share the pointer with the C allocator in pal/module.c.
Lower the kernel heap top by 16 bytes so the cell never overlaps the heap.

Signed-off-by: Maxim Menshikov <maksim.menshikov@nethermind.io>
When arguments are supplied, run them via /bin/bash -c in a non-interactive
container instead of always dropping into an interactive shell. With no
arguments, behavior is unchanged and still opens an interactive bash session.

Signed-off-by: Maxim Menshikov <maksim.menshikov@nethermind.io>
When optimizing, append fixed RyuJIT tuning options for the riscv64/ZisK
backend: larger stack-allocatable objects, moderately raised inlining caps,
inline DMA SequenceEqual lowering, and leaf-method RA save elision. Values are
hex-encoded as RyuJIT parses these knobs with NumberStyles.AllowHexSpecifier.
Several options depend on companion runtime patches (23, 25, 31,
30_dma_memcmp_inline).

Signed-off-by: Maxim Menshikov <maksim.menshikov@nethermind.io>
Replace the poisoned-pointer write in __wrap_RhpThrowEx with a plain exit(1).
The deliberate null-ish store was used to trap on unhandled managed exceptions,
but exiting the process directly avoids relying on undefined behavior and
produces a cleaner termination.

Signed-off-by: Maxim Menshikov <maksim.menshikov@nethermind.io>
Reserve the top 8 bytes of the heap region as a fixed-address cell holding the
downward bump pointer, shared by the C allocator and JIT-emitted inline
allocation. Lower the heap top by 16 so the cell never overlaps the heap.
zisk_sim reuses the zisk pal.o, so it needs the same g_zk_bump_ptr symbol;
mirrors modules/zkvm_zisk/script.ld.

Signed-off-by: Maxim Menshikov <maksim.menshikov@nethermind.io>
@maximmenshikov maximmenshikov merged commit e47ce02 into master Jun 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant