coverage: count number of executions per line#1265
Conversation
arcz
left a comment
There was a problem hiding this comment.
This looks good, I would just benchmark if this doesn't add too much overhead
|
I think either the workers will be frequently sending events (quite bad) or some counter will not be properly updated (not so bad, still not great). |
|
This is awesome, I want this feature so bad 😆 |
6c0a717 to
97007bc
Compare
|
I did a second attempt at implementing this a safer way. The code is quite ugly right now but if anyone wants to test/review it before I spend some more time on it I'd appreciate it 👍 |
|
I don't see this branch under Actions to download the binary 🤔 |
|
I think it is because it is a draft, let me convert it a proper PR |
97007bc to
559bbc1
Compare
|
@rappie There was a small git conflict, hopefully it builds now that I resolved it 👍 |
0b5d6a0 to
8d2cb5e
Compare
|
@samalws-tob can you take a look to this PR? |
| -- of `contract` for everything; it may be safe to remove this check. | ||
| when (pc < VMut.length vec) $ | ||
| when (pc < VMut.length vec) $ do | ||
| VMut.modify (fromJust maybeStatsVec) (\(execQty, revertQty) -> (execQty + 1, revertQty)) opIx |
There was a problem hiding this comment.
I don't see anywhere where we increment revertQty
There was a problem hiding this comment.
yeah, I have not implemented counting of reverts. I meant to do it at first but then it wasn't clear to me where I should be counting them. If you have any pointers there I'd appreciate them, otherwise I may remove the extra var at this time.
839d2d3 to
924dfb2
Compare
Revert counting is still not implemented.
|
I benchmarked this, looks like it cuts performance (calls/s) in half |
|
in #1305 tried doing |
|
I'm still very interested in this, despite the performance loss. It would be great to have this in |
Integrates PR crytic#1265 from upstream with performance-conscious architecture: - Feature disabled by default (~50% performance overhead when enabled) - Zero overhead when disabled (stats refs only allocated if trackLineHits=true) - Thread-local storage for safe multi-worker stats tracking - Stats combined from all threads at report generation time Usage: - CLI: echidna contract.sol --track-line-hits - Config: trackLineHits: true Coverage reports show execution counts and revert counts per line when enabled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
No description provided.