Skip to content

Add K modules for tracking coverage#79

Open
tothtamas28 wants to merge 4 commits into
masterfrom
coverage
Open

Add K modules for tracking coverage#79
tothtamas28 wants to merge 4 commits into
masterfrom
coverage

Conversation

@tothtamas28
Copy link
Copy Markdown
Contributor

@tothtamas28 tothtamas28 commented May 13, 2026

Tracks bytecode coverage for both the EVM and Wasm execution paths in the Stylus semantics. As a contract runs, the new rules record which byte ranges were executed, making coverage analysis of Stylus contracts possible.

Changes

  • Added <coverage> cell to the top-level configuration.
  • New COVERAGE module defining CovSpan (offset + length) and a total function #updateCoverage, which accumulates executed spans into a Map, indexed by account id, of Sets containing the spans.
  • EVM-COVERAGE module with a pc.inc.cov rule at priority(10), overriding the base pc.inc rule to update <coverage> on each program-counter increment.
  • WASM-COVERAGE module with a wasm-instr-cov rule at priority(10), overriding the base #instrWithPos rule to record each Wasm instruction's offset and length in <coverage>.
  • make kdist-build now sets _JAVA_OPTIONS="-Xmx32g" and runs on a single thread (dropping -j2) to handle the larger memory requirements of kompilation.

Comment thread src/skribe/kdist/stylus-semantics/evm-coverage.md Outdated
Comment thread src/skribe/kdist/stylus-semantics/wasm-coverage.md Outdated
@tothtamas28 tothtamas28 force-pushed the coverage branch 4 times, most recently from cabd5ad to 2572218 Compare May 14, 2026 14:26
tothtamas28 and others added 3 commits May 14, 2026 14:27
Co-authored-by: devops <Burak Bilge Yalçınkaya <bbyalcinkaya@gmail.com>
@tothtamas28 tothtamas28 requested a review from bbyalcinkaya May 14, 2026 15:20
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.

3 participants