Skip to content

fix(runtime): remove /dev/shm mmap file immediately after open#425

Merged
zoowii merged 3 commits intoDTVMStack:mainfrom
cmgCr:cmgCr/fix_memory
Mar 27, 2026
Merged

fix(runtime): remove /dev/shm mmap file immediately after open#425
zoowii merged 3 commits intoDTVMStack:mainfrom
cmgCr:cmgCr/fix_memory

Conversation

@cmgCr
Copy link
Copy Markdown
Contributor

@cmgCr cmgCr commented Mar 20, 2026

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

2. What is the scope of this PR (e.g. component or file name):

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains CI/CD configuration changes
  • Contains documentation changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

6. Release note

None

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

⚡ Performance Regression Check Results

✅ Performance Check Passed (interpreter)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.50 1.53 +1.7% PASS
total/main/blake2b_huff/empty 0.02 0.02 +1.4% PASS
total/main/blake2b_shifts/8415nulls 11.60 11.81 +1.8% PASS
total/main/sha1_divs/5311 5.09 5.23 +2.8% PASS
total/main/sha1_divs/empty 0.06 0.07 +3.0% PASS
total/main/sha1_shifts/5311 2.84 2.98 +5.0% PASS
total/main/sha1_shifts/empty 0.04 0.04 +5.0% PASS
total/main/snailtracer/benchmark 52.53 53.47 +1.8% PASS
total/main/structarray_alloc/nfts_rank 1.03 1.04 +1.6% PASS
total/main/swap_math/insufficient_liquidity 0.00 0.00 -1.4% PASS
total/main/swap_math/received 0.01 0.01 -0.9% PASS
total/main/swap_math/spent 0.00 0.00 -0.5% PASS
total/main/weierstrudel/1 0.29 0.29 -0.8% PASS
total/main/weierstrudel/15 3.16 3.16 -0.1% PASS
total/micro/JUMPDEST_n0/empty 2.11 1.31 -38.1% PASS
total/micro/jump_around/empty 0.09 0.09 -0.6% PASS
total/micro/loop_with_many_jumpdests/empty 30.57 20.02 -34.5% PASS
total/micro/memory_grow_mload/by1 0.09 0.09 +5.7% PASS
total/micro/memory_grow_mload/by16 0.10 0.10 +3.3% PASS
total/micro/memory_grow_mload/by32 0.11 0.11 +0.1% PASS
total/micro/memory_grow_mload/nogrow 0.09 0.09 +4.3% PASS
total/micro/memory_grow_mstore/by1 0.10 0.10 -1.0% PASS
total/micro/memory_grow_mstore/by16 0.11 0.11 -1.6% PASS
total/micro/memory_grow_mstore/by32 0.12 0.12 -3.0% PASS
total/micro/memory_grow_mstore/nogrow 0.09 0.09 +4.5% PASS
total/micro/signextend/one 0.24 0.24 -1.7% PASS
total/micro/signextend/zero 0.24 0.24 -1.1% PASS
total/synth/ADD/b0 3.52 2.02 -42.5% PASS
total/synth/ADD/b1 2.00 1.98 -1.1% PASS
total/synth/ADDRESS/a0 4.83 4.82 -0.2% PASS
total/synth/ADDRESS/a1 5.27 5.34 +1.3% PASS
total/synth/AND/b0 1.64 1.64 -0.1% PASS
total/synth/AND/b1 1.70 1.71 +0.9% PASS
total/synth/BYTE/b0 6.04 6.09 +0.9% PASS
total/synth/BYTE/b1 4.73 4.76 +0.6% PASS
total/synth/CALLDATASIZE/a0 3.21 3.07 -4.3% PASS
total/synth/CALLDATASIZE/a1 4.05 3.85 -4.7% PASS
total/synth/CALLER/a0 4.83 4.86 +0.8% PASS
total/synth/CALLER/a1 5.37 5.31 -1.2% PASS
total/synth/CALLVALUE/a0 3.10 3.26 +5.2% PASS
total/synth/CALLVALUE/a1 3.36 3.60 +7.3% PASS
total/synth/CODESIZE/a0 3.43 3.51 +2.3% PASS
total/synth/CODESIZE/a1 3.76 3.85 +2.2% PASS
total/synth/DUP1/d0 0.82 1.06 +29.3% PASS
total/synth/DUP1/d1 1.23 1.31 +6.7% PASS
total/synth/DUP10/d0 0.83 1.06 +28.5% PASS
total/synth/DUP10/d1 1.16 1.32 +13.7% PASS
total/synth/DUP11/d0 0.90 1.07 +18.6% PASS
total/synth/DUP11/d1 0.92 1.31 +42.9% PASS
total/synth/DUP12/d0 0.83 1.23 +48.3% PASS
total/synth/DUP12/d1 1.16 1.07 -7.1% PASS
total/synth/DUP13/d0 0.83 1.07 +29.2% PASS
total/synth/DUP13/d1 0.92 1.31 +42.8% PASS
total/synth/DUP14/d0 1.07 1.23 +15.1% PASS
total/synth/DUP14/d1 1.16 1.10 -4.6% PASS
total/synth/DUP15/d0 0.88 1.31 +49.4% PASS
total/synth/DUP15/d1 0.92 1.17 +26.2% PASS
total/synth/DUP16/d0 0.60 1.31 +117.8% PASS
total/synth/DUP16/d1 1.16 1.32 +13.7% PASS
total/synth/DUP2/d0 1.07 1.06 -0.5% PASS
total/synth/DUP2/d1 1.16 1.32 +13.8% PASS
total/synth/DUP3/d0 0.83 1.07 +29.4% PASS
total/synth/DUP3/d1 1.16 1.08 -7.0% PASS
total/synth/DUP4/d0 0.83 1.06 +28.7% PASS
total/synth/DUP4/d1 1.16 1.09 -5.4% PASS
total/synth/DUP5/d0 0.83 1.23 +48.7% PASS
total/synth/DUP5/d1 1.16 1.31 +13.7% PASS
total/synth/DUP6/d0 1.07 0.99 -7.3% PASS
total/synth/DUP6/d1 0.92 1.32 +43.3% PASS
total/synth/DUP7/d0 0.83 1.31 +58.2% PASS
total/synth/DUP7/d1 1.16 1.28 +11.0% PASS
total/synth/DUP8/d0 1.07 1.23 +15.2% PASS
total/synth/DUP8/d1 1.16 1.31 +13.6% PASS
total/synth/DUP9/d0 0.83 1.07 +29.5% PASS
total/synth/DUP9/d1 1.16 1.32 +13.9% PASS
total/synth/EQ/b0 2.72 2.70 -0.9% PASS
total/synth/EQ/b1 1.40 1.31 -5.9% PASS
total/synth/GAS/a0 3.67 3.76 +2.2% PASS
total/synth/GAS/a1 3.66 3.77 +2.8% PASS
total/synth/GT/b0 2.61 2.60 -0.4% PASS
total/synth/GT/b1 1.39 1.47 +5.8% PASS
total/synth/ISZERO/u0 0.99 1.14 +16.1% PASS
total/synth/JUMPDEST/n0 2.10 1.79 -14.5% PASS
total/synth/LT/b0 2.67 2.60 -2.6% PASS
total/synth/LT/b1 1.39 1.47 +5.8% PASS
total/synth/MSIZE/a0 4.25 4.26 +0.4% PASS
total/synth/MSIZE/a1 4.65 4.73 +1.8% PASS
total/synth/MUL/b0 5.30 5.30 +0.1% PASS
total/synth/MUL/b1 5.29 5.30 +0.1% PASS
total/synth/NOT/u0 1.68 1.67 -0.6% PASS
total/synth/OR/b0 1.63 1.63 +0.2% PASS
total/synth/OR/b1 1.71 1.71 +0.0% PASS
total/synth/PC/a0 3.17 3.18 +0.2% PASS
total/synth/PC/a1 4.03 3.52 -12.6% PASS
total/synth/PUSH1/p0 0.83 1.23 +48.3% PASS
total/synth/PUSH1/p1 1.14 1.30 +14.8% PASS
total/synth/PUSH10/p0 0.83 1.23 +48.6% PASS
total/synth/PUSH10/p1 1.21 1.31 +8.7% PASS
total/synth/PUSH11/p0 0.83 0.99 +19.0% PASS
total/synth/PUSH11/p1 1.21 1.31 +8.2% PASS
total/synth/PUSH12/p0 0.83 1.23 +48.7% PASS
total/synth/PUSH12/p1 1.23 1.31 +6.8% PASS
total/synth/PUSH13/p0 1.07 0.99 -7.5% PASS
total/synth/PUSH13/p1 1.20 1.31 +9.0% PASS
total/synth/PUSH14/p0 0.89 1.23 +38.3% PASS
total/synth/PUSH14/p1 1.23 1.32 +7.7% PASS
total/synth/PUSH15/p0 0.83 0.99 +19.1% PASS
total/synth/PUSH15/p1 1.05 1.43 +35.8% PASS
total/synth/PUSH16/p0 0.85 0.99 +16.0% PASS
total/synth/PUSH16/p1 1.20 1.31 +9.3% PASS
total/synth/PUSH17/p0 1.07 1.23 +15.3% PASS
total/synth/PUSH17/p1 1.20 1.31 +9.1% PASS
total/synth/PUSH18/p0 0.83 1.15 +38.7% PASS
total/synth/PUSH18/p1 1.21 1.32 +9.9% PASS
total/synth/PUSH19/p0 0.83 1.23 +48.5% PASS
total/synth/PUSH19/p1 1.21 1.33 +9.8% PASS
total/synth/PUSH2/p0 0.83 1.23 +48.2% PASS
total/synth/PUSH2/p1 1.15 1.31 +13.8% PASS
total/synth/PUSH20/p0 0.81 1.23 +52.1% PASS
total/synth/PUSH20/p1 1.21 1.31 +8.0% PASS
total/synth/PUSH21/p0 0.83 1.23 +47.9% PASS
total/synth/PUSH21/p1 1.21 1.31 +7.9% PASS
total/synth/PUSH22/p0 0.84 1.23 +46.2% PASS
total/synth/PUSH22/p1 1.22 1.31 +7.8% PASS
total/synth/PUSH23/p0 0.83 1.15 +39.2% PASS
total/synth/PUSH23/p1 1.00 1.32 +31.6% PASS
total/synth/PUSH24/p0 0.86 1.23 +43.8% PASS
total/synth/PUSH24/p1 1.21 1.33 +9.5% PASS
total/synth/PUSH25/p0 0.83 0.99 +19.0% PASS
total/synth/PUSH25/p1 1.21 1.32 +8.5% PASS
total/synth/PUSH26/p0 0.83 0.99 +19.0% PASS
total/synth/PUSH26/p1 1.21 1.31 +8.3% PASS
total/synth/PUSH27/p0 0.83 1.23 +48.0% PASS
total/synth/PUSH27/p1 1.23 1.31 +6.5% PASS
total/synth/PUSH28/p0 0.83 0.99 +18.9% PASS
total/synth/PUSH28/p1 1.23 1.31 +6.9% PASS
total/synth/PUSH29/p0 0.83 0.99 +19.2% PASS
total/synth/PUSH29/p1 1.22 1.31 +7.6% PASS
total/synth/PUSH3/p0 0.84 1.23 +47.3% PASS
total/synth/PUSH3/p1 1.21 1.31 +8.3% PASS
total/synth/PUSH30/p0 1.08 1.00 -7.5% PASS
total/synth/PUSH30/p1 1.22 1.32 +8.7% PASS
total/synth/PUSH31/p0 0.83 1.23 +48.2% PASS
total/synth/PUSH31/p1 1.31 1.42 +8.1% PASS
total/synth/PUSH32/p0 0.83 1.18 +41.6% PASS
total/synth/PUSH32/p1 1.22 1.31 +7.3% PASS
total/synth/PUSH4/p0 0.84 1.23 +46.4% PASS
total/synth/PUSH4/p1 1.20 1.31 +9.7% PASS
total/synth/PUSH5/p0 0.83 0.99 +18.3% PASS
total/synth/PUSH5/p1 1.20 1.32 +9.4% PASS
total/synth/PUSH6/p0 0.85 1.23 +45.2% PASS
total/synth/PUSH6/p1 1.21 1.31 +8.3% PASS
total/synth/PUSH7/p0 0.84 0.99 +17.6% PASS
total/synth/PUSH7/p1 1.21 1.31 +8.4% PASS
total/synth/PUSH8/p0 0.83 1.23 +48.1% PASS
total/synth/PUSH8/p1 1.20 1.31 +8.9% PASS
total/synth/PUSH9/p0 0.81 1.15 +42.4% PASS
total/synth/PUSH9/p1 1.21 1.31 +8.7% PASS
total/synth/RETURNDATASIZE/a0 3.27 3.43 +4.8% PASS
total/synth/RETURNDATASIZE/a1 3.60 3.76 +4.6% PASS
total/synth/SAR/b0 3.79 3.80 +0.1% PASS
total/synth/SAR/b1 4.30 4.32 +0.6% PASS
total/synth/SGT/b0 2.60 2.61 +0.4% PASS
total/synth/SGT/b1 1.63 1.56 -4.8% PASS
total/synth/SHL/b0 3.05 3.03 -0.7% PASS
total/synth/SHL/b1 1.64 1.68 +2.7% PASS
total/synth/SHR/b0 3.10 3.10 -0.1% PASS
total/synth/SHR/b1 1.51 1.55 +2.7% PASS
total/synth/SIGNEXTEND/b0 3.38 3.36 -0.5% PASS
total/synth/SIGNEXTEND/b1 3.54 3.44 -2.6% PASS
total/synth/SLT/b0 2.58 2.60 +0.7% PASS
total/synth/SLT/b1 1.63 1.56 -4.7% PASS
total/synth/SUB/b0 1.94 1.95 +0.4% PASS
total/synth/SUB/b1 1.98 1.97 -0.1% PASS
total/synth/SWAP1/s0 1.49 1.50 +0.9% PASS
total/synth/SWAP10/s0 1.50 1.52 +1.1% PASS
total/synth/SWAP11/s0 1.50 1.52 +1.2% PASS
total/synth/SWAP12/s0 1.51 1.52 +1.1% PASS
total/synth/SWAP13/s0 1.51 1.52 +1.2% PASS
total/synth/SWAP14/s0 1.51 1.52 +1.2% PASS
total/synth/SWAP15/s0 1.51 1.53 +1.3% PASS
total/synth/SWAP16/s0 1.51 1.53 +1.2% PASS
total/synth/SWAP2/s0 1.49 1.50 +1.0% PASS
total/synth/SWAP3/s0 1.49 1.50 +1.0% PASS
total/synth/SWAP4/s0 1.49 1.51 +1.0% PASS
total/synth/SWAP5/s0 1.49 1.51 +1.1% PASS
total/synth/SWAP6/s0 1.50 1.51 +0.9% PASS
total/synth/SWAP7/s0 1.50 1.51 +0.9% PASS
total/synth/SWAP8/s0 1.50 1.52 +1.0% PASS
total/synth/SWAP9/s0 1.50 1.52 +1.0% PASS
total/synth/XOR/b0 1.55 1.55 +0.0% PASS
total/synth/XOR/b1 1.55 1.55 -0.1% PASS
total/synth/loop_v1 4.76 4.65 -2.2% PASS
total/synth/loop_v2 4.76 4.76 -0.1% PASS

Summary: 194 benchmarks, 0 regressions


✅ Performance Check Passed (multipass)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.59 1.53 -3.9% PASS
total/main/blake2b_huff/empty 0.07 0.07 +1.7% PASS
total/main/blake2b_shifts/8415nulls 5.27 5.21 -1.0% PASS
total/main/sha1_divs/5311 1.89 1.89 +0.0% PASS
total/main/sha1_divs/empty 0.03 0.03 +1.0% PASS
total/main/sha1_shifts/5311 2.76 2.76 -0.0% PASS
total/main/sha1_shifts/empty 0.04 0.04 +0.8% PASS
total/main/snailtracer/benchmark 53.73 54.70 +1.8% PASS
total/main/structarray_alloc/nfts_rank 0.29 0.29 -0.0% PASS
total/main/swap_math/insufficient_liquidity 0.02 0.02 +4.7% PASS
total/main/swap_math/received 0.02 0.02 +4.3% PASS
total/main/swap_math/spent 0.02 0.02 +4.6% PASS
total/main/weierstrudel/1 0.36 0.36 +0.0% PASS
total/main/weierstrudel/15 3.25 3.23 -0.5% PASS
total/micro/JUMPDEST_n0/empty 0.13 0.13 +0.3% PASS
total/micro/jump_around/empty 0.63 0.63 +0.5% PASS
total/micro/loop_with_many_jumpdests/empty 1.96 1.97 +0.4% PASS
total/micro/memory_grow_mload/by1 0.18 0.19 +5.6% PASS
total/micro/memory_grow_mload/by16 0.19 0.20 +5.4% PASS
total/micro/memory_grow_mload/by32 0.21 0.22 +4.3% PASS
total/micro/memory_grow_mload/nogrow 0.18 0.19 +6.2% PASS
total/micro/memory_grow_mstore/by1 0.19 0.20 +4.9% PASS
total/micro/memory_grow_mstore/by16 0.20 0.21 +3.9% PASS
total/micro/memory_grow_mstore/by32 0.22 0.22 +4.1% PASS
total/micro/memory_grow_mstore/nogrow 0.18 0.19 +5.4% PASS
total/micro/signextend/one 0.35 0.35 -0.4% PASS
total/micro/signextend/zero 0.35 0.35 -0.2% PASS
total/synth/ADD/b0 0.01 0.01 +8.1% PASS
total/synth/ADD/b1 0.01 0.01 +7.5% PASS
total/synth/ADDRESS/a0 0.16 0.16 +1.3% PASS
total/synth/ADDRESS/a1 0.16 0.16 +0.8% PASS
total/synth/AND/b0 0.01 0.01 +8.1% PASS
total/synth/AND/b1 0.01 0.01 +7.4% PASS
total/synth/BYTE/b0 1.95 1.95 +0.1% PASS
total/synth/BYTE/b1 2.32 2.32 -0.0% PASS
total/synth/CALLDATASIZE/a0 0.08 0.08 -0.7% PASS
total/synth/CALLDATASIZE/a1 0.08 0.08 -0.9% PASS
total/synth/CALLER/a0 0.16 0.16 +0.7% PASS
total/synth/CALLER/a1 0.16 0.16 +0.8% PASS
total/synth/CALLVALUE/a0 0.27 0.28 +0.5% PASS
total/synth/CALLVALUE/a1 0.28 0.28 +0.5% PASS
total/synth/CODESIZE/a0 0.08 0.08 +1.6% PASS
total/synth/CODESIZE/a1 0.08 0.08 +1.6% PASS
total/synth/DUP1/d0 0.01 0.01 +8.0% PASS
total/synth/DUP1/d1 0.01 0.01 +7.4% PASS
total/synth/DUP10/d0 0.01 0.01 +8.0% PASS
total/synth/DUP10/d1 0.01 0.01 +7.4% PASS
total/synth/DUP11/d0 0.01 0.01 +8.0% PASS
total/synth/DUP11/d1 0.01 0.01 +7.4% PASS
total/synth/DUP12/d0 0.01 0.01 +8.1% PASS
total/synth/DUP12/d1 0.01 0.01 +7.3% PASS
total/synth/DUP13/d0 0.01 0.01 +7.9% PASS
total/synth/DUP13/d1 0.01 0.01 +7.3% PASS
total/synth/DUP14/d0 0.01 0.01 +8.1% PASS
total/synth/DUP14/d1 0.01 0.01 +7.4% PASS
total/synth/DUP15/d0 0.01 0.01 +8.0% PASS
total/synth/DUP15/d1 0.01 0.01 +7.4% PASS
total/synth/DUP16/d0 0.01 0.01 +8.0% PASS
total/synth/DUP16/d1 0.01 0.01 +7.5% PASS
total/synth/DUP2/d0 0.01 0.01 +8.0% PASS
total/synth/DUP2/d1 0.01 0.01 +7.4% PASS
total/synth/DUP3/d0 0.01 0.01 +7.9% PASS
total/synth/DUP3/d1 0.01 0.01 +8.3% PASS
total/synth/DUP4/d0 0.01 0.01 +7.9% PASS
total/synth/DUP4/d1 0.01 0.01 +7.4% PASS
total/synth/DUP5/d0 0.01 0.01 +8.0% PASS
total/synth/DUP5/d1 0.01 0.01 +7.4% PASS
total/synth/DUP6/d0 0.01 0.01 +8.1% PASS
total/synth/DUP6/d1 0.01 0.01 +7.4% PASS
total/synth/DUP7/d0 0.01 0.01 +8.0% PASS
total/synth/DUP7/d1 0.01 0.01 +7.3% PASS
total/synth/DUP8/d0 0.01 0.01 +8.0% PASS
total/synth/DUP8/d1 0.01 0.01 +7.4% PASS
total/synth/DUP9/d0 0.01 0.01 +8.1% PASS
total/synth/DUP9/d1 0.01 0.01 +7.4% PASS
total/synth/EQ/b0 0.01 0.01 +8.0% PASS
total/synth/EQ/b1 0.01 0.01 +7.4% PASS
total/synth/GAS/a0 0.80 0.80 +0.2% PASS
total/synth/GAS/a1 0.76 0.77 +0.2% PASS
total/synth/GT/b0 0.01 0.01 +8.1% PASS
total/synth/GT/b1 0.01 0.01 +7.5% PASS
total/synth/ISZERO/u0 0.01 0.01 +11.9% PASS
total/synth/JUMPDEST/n0 0.13 0.13 +0.1% PASS
total/synth/LT/b0 0.01 0.01 +8.0% PASS
total/synth/LT/b1 0.01 0.01 +7.5% PASS
total/synth/MSIZE/a0 0.01 0.01 +12.0% PASS
total/synth/MSIZE/a1 0.01 0.01 +11.9% PASS
total/synth/MUL/b0 0.01 0.01 +8.3% PASS
total/synth/MUL/b1 0.01 0.01 +7.3% PASS
total/synth/NOT/u0 0.01 0.01 +11.9% PASS
total/synth/OR/b0 0.01 0.01 +8.1% PASS
total/synth/OR/b1 0.01 0.01 +7.4% PASS
total/synth/PC/a0 0.01 0.01 +11.9% PASS
total/synth/PC/a1 0.01 0.01 +12.0% PASS
total/synth/PUSH1/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH1/p1 0.01 0.01 +9.1% PASS
total/synth/PUSH10/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH10/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH11/p0 0.01 0.01 +8.9% PASS
total/synth/PUSH11/p1 0.01 0.01 +9.2% PASS
total/synth/PUSH12/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH12/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH13/p0 0.01 0.01 +9.2% PASS
total/synth/PUSH13/p1 0.01 0.01 +9.2% PASS
total/synth/PUSH14/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH14/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH15/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH15/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH16/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH16/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH17/p0 0.01 0.01 +8.9% PASS
total/synth/PUSH17/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH18/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH18/p1 0.01 0.01 +9.2% PASS
total/synth/PUSH19/p0 0.01 0.01 +9.2% PASS
total/synth/PUSH19/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH2/p0 0.01 0.01 +8.7% PASS
total/synth/PUSH2/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH20/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH20/p1 0.01 0.01 +9.2% PASS
total/synth/PUSH21/p0 0.01 0.01 +8.9% PASS
total/synth/PUSH21/p1 0.01 0.01 +9.1% PASS
total/synth/PUSH22/p0 1.08 1.24 +15.6% PASS
total/synth/PUSH22/p1 1.25 1.32 +5.6% PASS
total/synth/PUSH23/p0 1.08 1.24 +15.2% PASS
total/synth/PUSH23/p1 1.23 1.33 +7.4% PASS
total/synth/PUSH24/p0 1.08 1.24 +15.3% PASS
total/synth/PUSH24/p1 1.21 1.32 +8.7% PASS
total/synth/PUSH25/p0 1.08 1.24 +15.6% PASS
total/synth/PUSH25/p1 1.22 1.32 +8.1% PASS
total/synth/PUSH26/p0 0.84 0.92 +9.9% PASS
total/synth/PUSH26/p1 1.23 1.35 +10.0% PASS
total/synth/PUSH27/p0 1.08 1.24 +15.3% PASS
total/synth/PUSH27/p1 1.23 1.32 +7.8% PASS
total/synth/PUSH28/p0 1.08 1.25 +15.7% PASS
total/synth/PUSH28/p1 1.23 1.33 +8.1% PASS
total/synth/PUSH29/p0 1.08 1.24 +15.3% PASS
total/synth/PUSH29/p1 1.25 1.35 +7.7% PASS
total/synth/PUSH3/p0 0.01 0.01 +8.9% PASS
total/synth/PUSH3/p1 0.01 0.01 +9.5% PASS
total/synth/PUSH30/p0 1.09 1.27 +16.4% PASS
total/synth/PUSH30/p1 1.22 1.36 +11.5% PASS
total/synth/PUSH31/p0 1.08 1.24 +15.3% PASS
total/synth/PUSH31/p1 1.34 1.47 +9.3% PASS
total/synth/PUSH32/p0 1.08 1.24 +15.2% PASS
total/synth/PUSH32/p1 1.25 1.36 +8.4% PASS
total/synth/PUSH4/p0 0.01 0.01 +8.9% PASS
total/synth/PUSH4/p1 0.01 0.01 +9.5% PASS
total/synth/PUSH5/p0 0.01 0.01 +8.9% PASS
total/synth/PUSH5/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH6/p0 0.01 0.01 +8.8% PASS
total/synth/PUSH6/p1 0.01 0.01 +9.3% PASS
total/synth/PUSH7/p0 0.01 0.01 +9.1% PASS
total/synth/PUSH7/p1 0.01 0.01 +9.2% PASS
total/synth/PUSH8/p0 0.01 0.01 +8.7% PASS
total/synth/PUSH8/p1 0.01 0.01 +9.2% PASS
total/synth/PUSH9/p0 0.01 0.01 +8.9% PASS
total/synth/PUSH9/p1 0.01 0.01 +10.4% PASS
total/synth/RETURNDATASIZE/a0 0.53 0.61 +16.0% PASS
total/synth/RETURNDATASIZE/a1 0.49 0.58 +17.2% PASS
total/synth/SAR/b0 3.78 3.79 +0.3% PASS
total/synth/SAR/b1 4.31 4.32 +0.1% PASS
total/synth/SGT/b0 0.01 0.01 +8.1% PASS
total/synth/SGT/b1 0.01 0.01 +7.2% PASS
total/synth/SHL/b0 3.06 3.05 -0.4% PASS
total/synth/SHL/b1 1.64 1.68 +2.4% PASS
total/synth/SHR/b0 3.11 3.11 +0.1% PASS
total/synth/SHR/b1 1.52 1.56 +2.7% PASS
total/synth/SIGNEXTEND/b0 3.13 3.11 -0.4% PASS
total/synth/SIGNEXTEND/b1 4.48 3.45 -23.1% PASS
total/synth/SLT/b0 0.01 0.01 +8.1% PASS
total/synth/SLT/b1 0.01 0.01 +7.5% PASS
total/synth/SUB/b0 0.01 0.01 +8.1% PASS
total/synth/SUB/b1 0.01 0.01 +7.4% PASS
total/synth/SWAP1/s0 0.01 0.01 +1.6% PASS
total/synth/SWAP10/s0 0.01 0.01 +1.5% PASS
total/synth/SWAP11/s0 0.01 0.01 +1.3% PASS
total/synth/SWAP12/s0 0.01 0.01 +1.3% PASS
total/synth/SWAP13/s0 0.01 0.01 +1.6% PASS
total/synth/SWAP14/s0 0.01 0.01 +1.0% PASS
total/synth/SWAP15/s0 0.01 0.01 +1.0% PASS
total/synth/SWAP16/s0 0.01 0.01 +1.5% PASS
total/synth/SWAP2/s0 0.01 0.01 +1.3% PASS
total/synth/SWAP3/s0 0.01 0.01 +1.1% PASS
total/synth/SWAP4/s0 0.01 0.01 +1.2% PASS
total/synth/SWAP5/s0 0.01 0.01 +1.2% PASS
total/synth/SWAP6/s0 0.01 0.01 +1.4% PASS
total/synth/SWAP7/s0 0.01 0.01 +1.5% PASS
total/synth/SWAP8/s0 0.01 0.01 +1.3% PASS
total/synth/SWAP9/s0 0.01 0.01 +1.8% PASS
total/synth/XOR/b0 0.01 0.01 +8.0% PASS
total/synth/XOR/b1 0.01 0.01 +7.4% PASS
total/synth/loop_v1 1.41 1.43 +1.9% PASS
total/synth/loop_v2 1.32 1.35 +2.1% PASS

Summary: 194 benchmarks, 0 regressions


Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes x64 singlepass JIT memory addressing for large offsets (avoiding disp32 sign-extension / 32-bit overflow corner cases) and addresses mmap-backed linear memory temp-file cleanup, with new WAST regressions for the reported OOB false-positive/false-negative scenarios.

Changes:

  • Add spec-extra WAST regressions for (1) large offset that should be in-bounds and (2) base+offset overflow that must trap.
  • Update x64 singlepass codegen load/store addressing to avoid incorrect effective addresses when offsets exceed signed disp32 range.
  • Unlink the mmap init file after opening to prevent /dev/shm temp-file accumulation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/wast/spec_extra/store_large_offset_false_positive_oob.wast New regression covering large offset addressing that should remain in-bounds (no trap).
tests/wast/spec_extra/store_imm_base_overflow_false_negative_oob.wast New regression covering base+offset overflow that must trap (detect missed OOB).
src/singlepass/x64/codegen.h Adjusts load/store address construction to avoid disp32 sign-extension pitfalls for large offsets.
src/runtime/memory.cpp Unlinks mmap init file after open and removes destructor-time forced removal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Stats.revertRecord(Timer);
goto try_use_mmap_init;
}
::remove(Path);
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

::remove(Path) is now the only cleanup for the temp mmap backing file (destructor removal was deleted). Since the return value is ignored, a failed unlink would reintroduce the /dev/shm file leak with no fallback cleanup. Please check the return value and either log+fallback to removing in the destructor (when it exists) or treat failure as disabling mmap-bucket for this module.

Suggested change
::remove(Path);
if (::remove(Path) != 0) {
ZEN_LOG_WARN("failed to remove mmap memory file '%s' (%s), "
"disabling mmap-bucket for this module",
Path, std::strerror(errno));
::close(MmapFileFd);
UseMmapBucket = false;
Stats.revertRecord(Timer);
goto try_use_mmap_init;
}

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +13
(module
(memory (;0;) 65131)

Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test declares an initial memory of 65131 pages (~4.27 GiB). In builds where ZEN_ENABLE_CPU_EXCEPTION is off (so MemAllocOptions.UseMmap is forced false and allocations go through SysMemPool/malloc), this is likely to abort/OOM during spec test execution. Consider moving this test to a category that only runs with CPU-exception/mmap enabled (e.g. tests/wast/exception) or otherwise gating it so it doesn't require allocating multi-GiB linear memory in non-mmap configurations.

Copilot uses AI. Check for mistakes.
@cmgCr cmgCr force-pushed the cmgCr/fix_memory branch 2 times, most recently from 8d7d752 to 74712bc Compare March 20, 2026 09:41
@cmgCr cmgCr changed the title fix(compiler): resolve large-offset OOB issues with memory cleanup fix(runtime): remove /dev/shm mmap file immediately after open Mar 20, 2026
@zoowii zoowii requested a review from Copilot March 23, 2026 17:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 199 to 202
}
if (MmapMemoryInitFd > 0) {
::close(MmapMemoryInitFd);
// delete the memory file forcely
int Status = ::remove(MmapMemoryFilepath);
if (Status != 0) {
ZEN_LOG_WARN("failed to remove mmap tmp memory file %s due to '%s'",
MmapMemoryFilepath, std::strerror(errno));
}
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MmapMemoryInitFd uses 0 as the “invalid” sentinel, and the destructor (and checkWasmMemoryCanUseMmap()) only close/accept the fd when > 0. Since POSIX open() can legally return fd 0 (e.g., if stdin is closed), this can leak the fd and—now that the file is unlinked—prevent tmpfs storage from being reclaimed until process exit. Use -1 as the sentinel and treat >= 0 as valid in both the close and the checkWasmMemoryCanUseMmap() logic.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update in new commit 9799750

@cmgCr cmgCr force-pushed the cmgCr/fix_memory branch from 4d4f361 to 9799750 Compare March 27, 2026 07:57
@zoowii zoowii merged commit f5a9d89 into DTVMStack:main Mar 27, 2026
16 checks passed
@cmgCr cmgCr deleted the cmgCr/fix_memory branch March 27, 2026 13:39
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.

A memory related bug.

3 participants