JAR: Join-Accumulate Refine

9.1. jar1 JAVM Configuration🔗

In jar1, the JAVM is configured differently from the base Gray Paper PVM specification:

  • Capability-based memory: the flat 4GB address space is managed through DATA capabilities. Each DATA cap owns a set of physical pages with exclusive mapping and per-page access control. See the JAVM Capability System chapter for details.

  • Single-pass gas metering: basic block gas costs are computed by a single-pass O(n) pipeline simulation rather than full pipeline tracking. This models decode throughput as the bottleneck, omitting EU contention (which is subsumed by decode for the rv64em instruction set).

  • Fixed u32 LE deblob: program blob headers use u32 little-endian encoding for counts and offsets, not the JAM codec's variable-length natural encoding.

  • Capability extensions: two additional exit reasons (ecall for management ops, trap for deliberate termination) beyond the base PVM's halt/panic/OOG/pageFault/hostCall. See the JAVM Capability System and Capability Kernel chapters for the multi-VM execution model.

🔗def
Jar.JAVM.gasCostForBlockSinglePass (code bitmask : ByteArray) (startPC : Nat) (memCycles : Nat := 25) : Nat
Jar.JAVM.gasCostForBlockSinglePass (code bitmask : ByteArray) (startPC : Nat) (memCycles : Nat := 25) : Nat

Compute gas cost for a basic block using the single-pass model. Returns max(maxDone - 3, 1).