# Hash-based Bisect Debugging

**URL:** <https://ziggit.dev/t/hash-based-bisect-debugging/5208>\
**Category:** Brainstorming\
**Tags:** language, compiler\
**Created:** [July 18, 2024, 3:59pm UTC](https://ziggit.dev/t/hash-based-bisect-debugging/5208 "2024-07-18T15:59:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnemnion](https://ziggit.dev/user_avatar/ziggit.dev/mnemnion/32/2478_2.png) [@mnemnion](https://ziggit.dev/u/mnemnion)\
**Post date:** [July 18, 2024, 3:59pm UTC](https://ziggit.dev/t/hash-based-bisect-debugging/5208/1 "2024-07-18T15:59:33Z")

</div>

Ran into an [interesting article](https://research.swtch.com/bisect) about a specific technique for identifying problems in a codebase. It’s especially applicable to compiler optimizations, and other cases of subtle misbehavior which can be hard to get to show up.

Russ Cox is a very smart guy. In addition to his work on Go lang, he’s the author of [re2](https://github.com/google/re2), one of the better regular expression libraries out there, and one of the first to be specifically hardened against regex strings which are ‘attacker controlled’ as we say.

I suspect that Zig’s comptime mechanism can really juice up a technique like the one described in the article, so I thought I’d share it.

---

<div class="post-metadata">

**Author:** ![dude\_the\_builder](https://ziggit.dev/user_avatar/ziggit.dev/dude_the_builder/32/557_2.png) [@dude\_the\_builder](https://ziggit.dev/u/dude_the_builder)\
**Post date:** [July 19, 2024, 1:21am UTC](https://ziggit.dev/t/hash-based-bisect-debugging/5208/2 "2024-07-19T01:21:11Z")

</div>

Applying an algorithm to speed up finding the bug in my algorithm. Genius programmer brain. Thanks for sharing this.
