Skip to content

Implement coverage feedback loop#84

Open
tothtamas28 wants to merge 3 commits into
masterfrom
coverage-loop
Open

Implement coverage feedback loop#84
tothtamas28 wants to merge 3 commits into
masterfrom
coverage-loop

Conversation

@tothtamas28
Copy link
Copy Markdown
Contributor

@tothtamas28 tothtamas28 commented May 19, 2026

Wires up a real coverage feedback loop by parsing KORE output into a kore::Pattern tree and extracting data from the <coverage> cell, replacing the previous stub.

Changes

  • get_exit_code and write_coverage_data now take &kore::Pattern instead of &kllvm::Block, dropping the regex-based string scraping.
  • get_coverage_size is derived from actual coverage instead of a hardcoded 100.
  • Adds kllvm_kore_block_dump_hotfix to trim raw dump output at the <generatedCounter> terminator, working around an upstream bug.
  • Reverts the 64 MB stack size workaround: the <coverage> cell no longer has extreme nesting depth.

@tothtamas28 tothtamas28 self-assigned this May 19, 2026
@tothtamas28 tothtamas28 requested a review from gtrepta May 19, 2026 20:50
@tothtamas28 tothtamas28 marked this pull request as ready for review May 19, 2026 20:50
@tothtamas28 tothtamas28 marked this pull request as draft May 20, 2026 08:19
@tothtamas28 tothtamas28 force-pushed the coverage-loop branch 2 times, most recently from 5f02d61 to 8a40447 Compare May 20, 2026 09:27
@tothtamas28 tothtamas28 marked this pull request as ready for review May 20, 2026 12:58
Copy link
Copy Markdown
Contributor

@gtrepta gtrepta left a comment

Choose a reason for hiding this comment

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

LGTM. Nice utilities for getting info out of the config!

Have you ran this with the 9lives contract? I'm running the test_end_to_end_intense function and I see it finding lots of "Objectives" which would be non-zero exit codes, and the coverage isn't changing too much, so I'm not sure if I'm building the contract and the spec correctly.

Comment thread skribe-fuzz-rs/src/lib.rs
Comment on lines +138 to +142
pub fn kllvm_kore_block_dump_hotfix(s: &str) -> &str {
// TODO This is a hotfix for a bug in kore_block_dump
let terminator = r#"Lbl'-LT-'generatedCounter'-GT-'{}(\dv{SortInt{}}("0")))"#;
let pos = s.find(terminator).expect("terminator not found");
&s[..pos + terminator.len()]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hm, are there some garbage bytes showing up after this terminator? I think I remember observing this while I was dealing with the latin-1 decoding issue we had, but I assumed this was a part of that issue.

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