frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

The Grug Brained Developer (2022)

https://grugbrain.dev/
188•smartmic•1h ago•47 comments

Honda conducts successful launch and landing of experimental reusable rocket

https://global.honda/en/topics/2025/c_2025-06-17ceng.html
675•LorenDB•6h ago•217 comments

Resurrecting a dead torrent tracker and finding 3M peers

https://kianbradley.com/2025/06/15/resurrecting-a-dead-tracker.html
259•k-ian•4h ago•81 comments

Building Effective AI Agents

https://www.anthropic.com/engineering/building-effective-agents
150•Anon84•4h ago•31 comments

Bzip2 crate switches from C to 100% rust

https://trifectatech.org/blog/bzip2-crate-switches-from-c-to-rust/
35•Bogdanp•1h ago•1 comments

Making 2.5 Flash and 2.5 Pro GA, and introducing Gemini 2.5 Flash-Lite

https://blog.google/products/gemini/gemini-2-5-model-family-expands/
237•meetpateltech•5h ago•143 comments

AMD's CDNA 4 Architecture Announcement

https://chipsandcheese.com/p/amds-cdna-4-architecture-announcement
69•rbanffy•4h ago•14 comments

Foundry (YC F24) Hiring Early Engineer to Build Web Agent Infrastructure

https://www.ycombinator.com/companies/foundry/jobs/azAgJbN-foundry-software-engineer-new-grad-to-mid-level
1•lakabimanil•54m ago

Time Series Forecasting with Graph Transformers

https://kumo.ai/research/time-series-forecasting/
48•turntable_pride•3h ago•17 comments

What Google Translate Can Tell Us About Vibecoding

https://ingrids.space/posts/what-google-translate-can-tell-us-about-vibecoding/
38•todsacerdoti•2h ago•5 comments

Why JPEGs still rule the web (2024)

https://spectrum.ieee.org/jpeg-image-format-history
105•purpleko•7h ago•191 comments

AI will shrink Amazon's workforce in the coming years, CEO Jassy says

https://www.cnbc.com/2025/06/17/ai-amazon-workforce-jassy.html
43•rntn•1h ago•33 comments

Tetrachromatic Vision

https://www.bookofjoe.com/2025/05/my-entry-32.html
11•surprisetalk•3d ago•2 comments

After millions of years, why are carnivorous plants still so small?

https://www.smithsonianmag.com/articles/carnivorous-plants-have-been-trapping-animals-for-millions-of-years-so-why-have-they-never-grown-larger-180986708/
25•gmays•4d ago•13 comments

From SDR to 'Fake HDR': Mario Kart World on Switch 2

https://www.alexandermejia.com/from-sdr-to-fake-hdr-mario-kart-world-on-switch-2-undermines-modern-display-potential/
20•ibobev•2h ago•6 comments

Programming Language Design in the Era of LLMs: A Return to Mediocrity?

https://kirancodes.me/posts/log-lang-design-llms.html
63•gopiandcode•2h ago•46 comments

The hamburger-menu icon today: Is it recognizable?

https://www.nngroup.com/articles/hamburger-menu-icon-recognizability/
56•thm•7h ago•111 comments

A Rural Public Transit Odyssey

https://shagbark.substack.com/p/a-rural-public-transit-odyssey
9•herbertl•3d ago•0 comments

Real-time action chunking with large models

https://www.pi.website/research/real_time_chunking
29•pr337h4m•2h ago•1 comments

Bots are overwhelming websites with their hunger for AI data

https://www.theregister.com/2025/06/17/bot_overwhelming_websites_report/
14•Bender•28m ago•6 comments

AMD's Pre-Zen Interconnect: Testing Trinity's Northbridge

https://chipsandcheese.com/p/amds-pre-zen-interconnect-testing
94•zdw•3d ago•17 comments

The magic of through running

https://www.worksinprogress.news/p/the-magic-of-through-running
154•ortegaygasset•12h ago•99 comments

O3 Turns Pro

https://thezvi.substack.com/p/o3-turns-pro
142•jsnider3•7h ago•100 comments

Voyager: Real-Time Splatting City-Scale 3D Gaussians on Your Phone

https://arxiv.org/abs/2506.02774
39•PaulHoule•8h ago•14 comments

Attempting to Make the Smallest* Electric Motor [video]

https://www.youtube.com/watch?v=6x_NMytSA90
80•surprisetalk•3d ago•6 comments

CPU-Based Layout Design for Picker-to-Parts Pallet Warehouses

https://arxiv.org/abs/2506.04266
15•PaulHoule•6h ago•3 comments

Miscalculation by Spanish power grid operator REE contributed to blackout

https://www.reuters.com/business/energy/investigation-into-spains-april-28-blackout-shows-no-evidence-cyberattack-2025-06-17/
92•croes•5h ago•33 comments

What happens when clergy take psilocybin

https://nautil.us/clergy-blown-away-by-psilocybin-1217112/
326•bookofjoe•1d ago•469 comments

Calculating Oil Storage Tank Occupancy with Help of Satellite Imagery

https://medium.com/planet-stories/a-beginners-guide-to-calculating-oil-storage-tank-occupancy-with-help-of-satellite-imagery-e8f387200178
26•marklit•2d ago•7 comments

Guidelines on how to be a scientific sleuth released

https://osf.io/2kdez/wiki/home/
40•crescit_eundo•4h ago•2 comments
Open in hackernews

Cmapv2: A high performance, concurrent map

https://github.com/sirgallo/cmapv2
40•sirgallo•1d ago

Comments

sirgallo•1d ago
Performance comparisons are made against go sync.Map, with cmapv2 on par or sometimes exceeding is on different workloads. It is both lock-free and thread safe, using atomic operations. It also supports sharding out of the box. cmapv2 with 10m k/v pairs where keys and values are 64bytes was able to achieve 1.5m w/s and 3m r/s.
pstuart•6h ago
Looks interesting, it would be nice to have the performance comparisons front and center on the readme.
sirgallo•3h ago
sounds good, they are a bit hidden right now. also am most likely going to update the other docs.
latchkey•4h ago
I've been using this one for years, can you do comparisons against it?

https://github.com/cornelk/hashmap

jzelinskie•3h ago
Another good comparison would be against https://pkg.go.dev/github.com/puzpuzpuz/xsync/v3#Map
sirgallo•3h ago
definitely, I can expand my comparisons and benchmarks
latchkey•2h ago
Honestly, if you're better than the rest, I would suggest collaborating with the existing solutions.
sirgallo•3h ago
yes I can take a look, thanks for passing that along
gttalbot•4h ago
Is it anywhere close to swisstables?
vlovich123•3h ago
No because swisstables generally don't do concurrency (i.e. concurrency ==> atomics which are inherently more expensive due to HW reasons).
kiitos•3h ago
This repo is completely unsound, code like [1] is pervasive and demonstrates a total misunderstanding of what guarantees are provided -- or, really, not provided -- by "atomic" reads of unsafe.Pointer values. Data races everywhere!

Not safe, do not pass go, do not collect $200, absolutely do not use.

[1] https://github.com/sirgallo/cmapv2/blob/280e3017ae4ba212f6f8...

kiitos•2h ago
Be more specific? OK

---

CopyNode broken

`CopyNode` duplicates only the parent; every child pointer is still shared

    nodeCopy.setChildren(make([]*node, len(n.children)))
    copy(nodeCopy.children, n.children) // pointers reused
https://github.com/sirgallo/cmapv2/blob/main/node.go#L11-L17

Any later mutation (for example `setValue`) writes through those shared pointers, so readers and historical snapshots are modified concurrently -- invalid, data race, memory model violation

---

Bitmap corruption

`SetBit` uses XOR rather than “set”:

    func SetBit(bitmap uint32, position int) uint32 { return bitmap ^ (1 << position) }
https://github.com/sirgallo/cmapv2/blob/main/utils.go#L41-L4...

Calling it twice on the same index flips the bit back to 0. During branch-creation on insert and during delete, this function is invoked multiple times on the same index, clearing a bit that should remain set and leaving orphaned children.

---

Invalid assumptions re: interior pointers

Only the root pointer is read with `atomic.LoadPointer`. All deeper fields like `children[pos]`, `bitmap`, and the byte-slice keys/values, are accessed directly after a successful CAS. Readers therefore race with writers that mutate these fields in place -- race condition, memory model violation, etc.

    pos := cMap.getPosition(node.Bitmap(), hash, level)
    if node.Child(pos).IsLeaf() && bytes.Equal(key, node.Child(pos).Key()) {
        return node.Child(pos).Value()
    }

https://github.com/sirgallo/cmapv2/blob/main/operation.go#L5...

---

All xxxRecursive functions rely on those invalid interior pointer assumptions

Sequence in `putRecursive` / `deleteRecursive` is

    1. `curr := atomic.LoadPointer(ptr)`
    2. Build `nodeCopy`
    3. Recurse; grandchildren are mutated in place
    4. `atomic.CompareAndSwap(ptr, curr, nodeCopy)`
https://github.com/sirgallo/cmapv2/blob/main/operation.go#L1...

If another goroutine has already swapped in a different copy of `curr` (and mutated it) the CAS still succeeds because the pointer value is unchanged, merging incompatible sub-tries and corrupting the data

---

Use-after-free in sync.Pool

On CAS failure the freshly built `nodeCopy` is immediately returned to a `sync.Pool` -- undefined behavior

    cMap.pool.PutNode(nodeCopy) // may race with outstanding readers
https://github.com/sirgallo/cmapv2/blob/main/operation.go#L1...

Other goroutines still holding references to that node can now access a reclaimed object, oops.

---

K/V Aliasing

Keys and values (both []byte slices, which are not safe for concurrent r/w access) are stored by reference, a mistake:

    n.setKey(key)
    n.setValue(value)
If the caller mutates those slices later (or concurrently in another goroutine), data races ahoy

---

Reader panics, etc.

    - `getRecursive` accesses `children[pos]` without bounds or nil checks, concurrent shrink can make `pos` invalid
    - `GetIndex` allows a negative `shiftSize` once `level >= 7` with `chunkSize = 5`, producing nonsense indices and potential slice-out-of-bounds
johnisgood•2h ago
> both []byte slices, which are not safe for concurrent r/w access

You must clone the slice on both write and read, right?

I get that cloning incurs a memory allocation and a copy operation, but this is the price for safety when concurrent access is possible or your data may be bodified outside your structure.

You could probably intern immutable keys, or avoid storing if keys already exist and are immutable, or use an object pool (like sync.Pool) to reduce allocations if this happens at scale. Anything else I am missing?

sapiogram•40m ago
> You must clone the slice on both write and read, right?

I haven't looked at the code, but that doesn't make sense to me. If you can't read the slice safely, you also can't clone it safely.

sapiogram•2h ago
Thank you for debunking it so I didn't have to. I don't think I've ever seen someone post a low-level/concurrent data structure in Go that wasn't wildly unsound, so I assumed this was too.
diagraphic•2h ago
There are many good implementations.
ecshafer•1h ago
Go is made by Google. Do they not have someone writing an equivalent of Java.util.concurrent.ConcurrentHashMap?
sapiogram•1h ago
They do, there's a concurrent hashmap in the standard library. It doesn't get posted here or on Reddit, though.