Skip to content

Implement Set-based coverage tracking#95

Merged
tothtamas28 merged 2 commits into
masterfrom
set-based-coverage
Jun 1, 2026
Merged

Implement Set-based coverage tracking#95
tothtamas28 merged 2 commits into
masterfrom
set-based-coverage

Conversation

@tothtamas28
Copy link
Copy Markdown
Contributor

@tothtamas28 tothtamas28 commented May 27, 2026

Replaces the previous Bytes-based approach to coverage tracking with a structured Set-based representation. Coverage is now stored as a Map of #coverage(size, entries) values rather than raw Bytes arrays, where entries is a K Set of #covEntry(offset, length) records.

Motivation

The Set representation avoids copying a large byte array on each update (including idempotent ones), and accumulates entries in a persistent set instead.

Changes

K semantics: coverage.md

  • Add CovEntry and Coverage syntax productions
  • #initCoverage initializes accounts with #coverage(size, .Set) instead of zero-padded Bytes
  • #updateCoverage accumulates entries via #addEntry, inserting into the Set with |Set SetItem(ENTRY)

Rust FFI: skribe-fuzz-rs/src/lib.rs

  • Add match_coverage / match_cov_entry to deserialize the new K pattern format
  • Add match_set / collect_set_entries to flatten K's left-associative Set
  • write_coverage_data expands entries into 0xff byte ranges, preserving the fuzzer bitmap interface
  • Extract shared match_dv / match_symbol / match_app helpers
  • Fix get_cell to return the matched node rather than its first child

@tothtamas28 tothtamas28 self-assigned this May 27, 2026
@tothtamas28 tothtamas28 requested a review from gtrepta May 27, 2026 13:55
@tothtamas28 tothtamas28 marked this pull request as ready for review May 27, 2026 14:30
@tothtamas28 tothtamas28 merged commit 64558b1 into master Jun 1, 2026
5 checks passed
@tothtamas28 tothtamas28 deleted the set-based-coverage branch June 1, 2026 09:27
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