• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lduchosal / ipnetwork / 1009
94%

Build:
DEFAULT BRANCH: master
Ran 18 Aug 2026 06:40AM UTC
Jobs 1
Files 48
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Aug 2026 06:34AM UTC coverage: 94.069% (+0.06%) from 94.011%
1009

push

appveyor

web-flow
fix: publish the broadcast cache atomically (#429) (#436)

Contains() could silently return a wrong result under concurrency.

The broadcast cache was a BigInteger?, a 24 byte struct spanning three
fields (hasValue, BigInteger._sign and BigInteger._bits), read on a
lock-free fast path. Neither the read nor the write of such a struct is
atomic, so a reader could observe hasValue == true while the magnitude
was still half written, and compute a broadcast address of 0 or 1
instead of the real one. Contains() then answered false for addresses
that are in the network.

Measured on arm64: the torn state stayed observable for 7 to 19 us, not
a few nanoseconds, because the publishing thread can be descheduled
between the individual stores. Every reader taking the fast path during
that window gets a wrong answer.

The cache is now a volatile StrongBox<BigInteger>: a reference is
published by a single atomic store, and volatile orders that store
after the box is fully initialised. The double-checked lock is dropped
because CreateBroadcast is pure, so a racing duplicate computation is
harmless and cheaper than serialising every first access. That also
removes the per-instance sync object, one allocation less for every
IPNetwork2 ever created.

Tests: two race detectors plus one deterministic structural guard. The
race detectors only reproduce on weakly ordered multi-core machines, so
the structural guard is what protects the invariant on CI: it fails if
the cache ever goes back to a multi-word value type.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

2284 of 2428 relevant lines covered (94.07%)

487916.24 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1009.1 18 Aug 2026 06:40AM UTC 48
94.07
Source Files on build 1009
  • Tree
  • List 48
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b1148efa on github
  • Prev Build on master (#1007)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc