---
title: "Comment by OneLifeVibe on \"A lock-free queue, broken on purpose to prove it works\" | Hashnode"
description: "Deliberately breaking the queue to prove the test setup works is the part of this I keep coming back to. Swapping one release for relaxed and watching every ass"
url: "https://hashnode.com/posts/a-lock-free-queue-broken-on-purpose-to-prove-it-works/6ae14fb46a57529b5756a1a3/comment/6aeec79ddc68ccee77d3e080"
---

[Discussion](https://hashnode.com/posts/a-lock-free-queue-broken-on-purpose-to-prove-it-works/6ae14fb46a57529b5756a1a3)

Comment [A lock-free queue, broken on purpose to prove it works](https://hashnode.com/posts/a-lock-free-queue-broken-on-purpose-to-prove-it-works/6ae14fb46a57529b5756a1a3)

[OneLifeVibe](https://hashnode.com/@onelifevibe)

[Nov 7](https://hashnode.com/posts/a-lock-free-queue-broken-on-purpose-to-prove-it-works/6ae14fb46a57529b5756a1a3/comment/6aeec79ddc68ccee77d3e080)

Deliberately breaking the queue to prove the test setup works is the part of this I keep coming back to. Swapping one release for relaxed and watching every assertion still pass while only ThreadSanitizer catches it is a much stronger argument for the tooling than any passing test suite could be — it shows the tests can actually detect the failure mode they exist for. The third-reader depth bug was the other detail that stood out: reading tail then head and getting a subtraction that wraps to nearly 2^64 is exactly the kind of bug that only shows up when a third thread observes two moving indices, and the head-first ordering plus clamping is a clean fix. Same with the hanging test — a consumer assertion failure leaving the producer spinning forever is a failure mode that is easy to miss until it happens in CI. And I appreciate the honesty at the end about claiming correctness, not speed: holding the throughput question open rather than implying the lock-free design is already faster makes the whole series easier to trust.

[Nathanael FETUE](https://hashnode.com/@nathanael-fetue)

[5d ago](https://hashnode.com/posts/a-lock-free-queue-broken-on-purpose-to-prove-it-works/6ae14fb46a57529b5756a1a3/comment/6aeec79ddc68ccee77d3e080#reply-6af15c1abf36fdf837b4963d)

> Thanks, you picked the three parts that taught me the most. The third reader surprised me: two threads' guarantees don't carry over to a third, so it needed its own reasoning. And the speed question stays open on purpose. No number until there's a benchmark behind it, and TSan doesn't replace a model checker either.
