frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

New US homeownership measure puts people first

https://www.minneapolisfed.org/article/2026/new-homeownership-measure-puts-people-first
49•throw0101a•58m ago•26 comments

Qwen-Image-3.0: Rich Content, Authentic Details, Deep Knowledge

https://qwen.ai/blog?id=qwen-image-3.0
251•ilreb•4h ago•116 comments

Incremental – A library for incremental computations

https://github.com/janestreet/incremental
260•handfuloflight•9h ago•50 comments

Who's afraid of Chinese models?

https://stratechery.com/2026/whos-afraid-of-chinese-models/
746•mfiguiere•1d ago•558 comments

Python 3.15's Ultra-Low Overhead Interpreter Profiling Mode – Ken Jin's Blog

https://fidget-spinner.github.io/posts/ultra-fast-tracing.html
26•rbanffy•6d ago•0 comments

Arduino Launches Plug-and-Play Modules for Long-Range Sensor Projects

https://www.allaboutcircuits.com/news/arduino-launches-plug-and-play-modules-for-long-range-senso...
41•WaitWaitWha•3d ago•15 comments

Jelly UI: Soft-body physics for native HTML form controls

https://jelly-ui.com/
558•baldvinmar•19h ago•166 comments

Kimi Work

https://www.kimi.com/products/kimi-work
605•ms7892•19h ago•250 comments

Human mathematicians are being outcounterexampled

https://xenaproject.wordpress.com/2026/07/20/human-mathematicians-are-being-outcounterexampled/
386•artninja1988•17h ago•174 comments

How to pack ternary numbers in 8-bit bytes

https://compilade.net/blog/ternary-packing
45•JoshTriplett•6d ago•27 comments

Running Doom on Our Custom CPU and Going Viral

https://www.armaangomes.com/blogs/doom/
94•arghunter•9h ago•20 comments

Nativ: Run frontier open models locally on your Mac

https://blaizzy.github.io/nativ/
308•aratahikaru5•18h ago•104 comments

Show HN: Immersive Gaussian Splat tour of grace cathedral, San Francisco

https://vincentwoo.com/3d/grace_cathedral/
203•akanet•16h ago•45 comments

VTubing: How a Japanese Phenomenon Is Going Worldwide

https://www.tokyodev.com/articles/vtubing-how-a-japanese-phenomenon-is-going-worldwide
54•pwim•9h ago•40 comments

A Koi Pond Mosaic Made from 10 Pounds of 3D Printer Waste

https://www.instructables.com/A-Koi-Pond-Mosaic-Made-From-10-Pounds-of-3D-Printe/
46•sudo_cowsay•9h ago•37 comments

I wrote an bash enumerator because I was sick of xargs

https://numerlab.org/2025/07/20/bashumerate-enumerator/
158•wallach-game•16h ago•145 comments

Agent swarms and the new model economics

https://cursor.com/blog/agent-swarm-model-economics
227•jlaneve•18h ago•103 comments

The Psychology of Software Teams

https://www.routledge.com/The-Psychology-of-Software-Teams/Hicks/p/book/9781032963389
120•dcre•5d ago•35 comments

Show HN: Ex Situ – Open-source spatial index of displaced cultural artifacts

https://exsitu.app/map
41•hbyel•8h ago•26 comments

Launch HN: Bloomy (YC S26) – AI-powered mastery learning for K-12

92•alexsouthmayd•20h ago•93 comments

China’s open-weights AI strategy is winning

https://werd.io/american-ai-is-locked-down-and-proprietary-its-losing/
1149•benwerd•22h ago•864 comments

You only need the frontier model for one single edit

https://stencil.so/blog/prewalk
184•jxmorris12•6d ago•55 comments

I Stopped “Creating Content”

https://refactoringenglish.com/blog/why-i-stopped-creating-content/
213•mtlynch•21h ago•170 comments

Shinjuku Station in 3D

https://satoshi7190.github.io/Shinjuku-indoor-threejs-demo/
246•Gecko4072•23h ago•55 comments

Perfection is not over-engineering

https://var0.xyz/posts/perfection-is-not-over-engineering.html
257•var0xyz•22h ago•112 comments

The Power of Awareness: Overcoming Surveillance Capitalism

https://www.scottrlarson.com/presentations/overcoming-surveillance-capitalism-with-awareness/
129•trinsic2•16h ago•25 comments

Jellyfin founder Andrew leaves team

https://forum.jellyfin.org/t-project-leadership-changes
282•swat535•13h ago•245 comments

Hacker wipes Romania's land registry database

https://news.risky.biz/risky-bulletin-hacker-wipes-romanias-entire-land-registry-database/
671•speckx•23h ago•372 comments

How we measured AI writing across arXiv, and where the measurement breaks

https://unslop.run/blog/measuring-ai-writing-on-arxiv
228•dopamine_daddy•20h ago•156 comments

Corners Don't Look Like That: Regarding Screenspace Ambient Occlusion (2012)

https://nothings.org/gamedev/ssao/
179•firephox•21h ago•81 comments
Open in hackernews

How to pack ternary numbers in 8-bit bytes

https://compilade.net/blog/ternary-packing
45•JoshTriplett•6d ago

Comments

JoshTriplett•6d ago
It's impressive how close to optimal this is.

You can beat the efficiency of 5 trits in 8 bits (1.6) with as few as 17 trits in 27 bits (~1.588), but once you account for rounding up to a whole number of bytes for practical reasons, then beating the efficiency requires going to at least 111 trits in 176 bits (~1.586), or perhaps more practically for fast unpacking, 161 trits in 256 bits (~1.59).

At that level, even if you have, say, 27B trits, the more efficient encodings would save something like 38-45MB (theoretical limit ~48MB), likely at the cost of some slowdown.

kleton•4h ago
Would this imply that the matrices should have dimensions of multiples of 40?
jjgreen•4h ago
Possible application: https://thedailywtf.com/articles/What_Is_Truth_0x3f_
benj111•4h ago
Off the top of my head. Compilers. You may know that a value has known 1s and 0s and unknowns. This would allow you to represent that for optimisation purposes.
Imustaskforhelp•2h ago
Arturo[0] language supports true,false and maybe. I really liked that idea actually, worth mentioning here.

so valid arturo code can be like (picked from their in-a-nutshell documentation)

i1: true

i2: false

i3: maybe

[0]: https://arturo-lang.io/documentation/in-a-nutshell

taneq•1h ago
Everyone hates null but (in database land, and arguably in other programming) it just means “no data.”

(As an aside, I found the characterisation of null as being a “billion dollar mistake” to be unfair. Those who don’t acknowledge null are doomed to reimplement it, probably poorly, or to have the unknowns in their logic remain unknown unknowns.)

mcherm•28m ago
The "mistake" was not in providing a way to represent "no data", it was in providing no way to represent "this definitely HAS" data.

Languages that correct the problem have two separate types (eg: Foo & Option<Foo>) meaning "definitely a Foo" and "a Foo but it might have no data". Java just has Foo, meaning "a Foo but it might have no data" but no way to represent "definitely a Foo".

mi_lk•3h ago
Had a good chuckle
abcd_f•2h ago
If it weren't for Bool as a name, that's just 0 for OK, non-zero for errors with 1 being general failure.
woadwarrior01•28m ago
I've seen this pattern repeated in a number of large production codebases using optional booleans.
Joker_vD•3h ago
> Fixed point numbers to the rescue!

    > a diagram that shows that dividing 0x7F (127) by 243 and then multiplying by 256 results in 0x86 (134)
> Tada!

How... how does that help with anything?

> Now digits can be easily extracted from the top two bits of the resulting 10-bit number when multiplying this 8-bit byte by 3.

What? Why? How? This is supposed to be the most insightful part of the post, and it's literally just "Behold!" from that one proof of Pythagorean theorem. Could someone please elaborate it for a non-genius like me?

marginalia_nu•3h ago
If it's any consolation, I spent like two years of my life immersed in this field[1] and can still recite powers of three in the same way most nerds can only tell you powers of two, yet I still can't follow this floating point black magic.

[1] behold my misspent youth: https://tunguska.sf.net/

StilesCrisis•31m ago
Fixed point! Not floating. That's the whole trick.
marginalia_nu•29m ago
Ah, then it makes at least some sense.
Tepix•3h ago
If your pack_number function builds the number up, the standard way to break it down is by extracting the least significant digit first using modulo and division. To get something that works well with SIMD we need a different approach. Instead of extracting the least significant digit from the bottom of an integer, we extract the most significant digit from the top of a fraction.

1. Convert to a fixed-point fraction: We scale our integer N into a fixed-point representation (e.g., using a 32-bit integer to represent the fraction). We do this by multiplying N by a precomputed reciprocal of 243.

2. Multiply by the base: Multiply the fraction by 3.

3. Extract: The integer portion of the result is your most significant trit.

4. Mask: Keep only the fractional remainder, and repeat.

The only operations here are multiplication, bitwise shift, and bitwise AND, i.e. perfectly suited for SIMD.

(in step 1 we replace the division with a multiplication by using the reciprocal. SIMD uses fixed-point integer arithmetic, not floating-point decimals)

evrimoztamur•1h ago
Would having 16 bits to pack a tuple of ternary numbers have a potential to give even better efficiency?
quietbritishjim•43m ago
No.

The article suggests using 8 bits (=256 values) to pack 5 trits (=243 values).

If you use 16 bits (=65536 values) then you can pack at most 10 whole trits (=59049 values). 11 trits (=177147 values) won't fit.

The current top comment, by JoshTriplett, analyses what you would need to beat the efficiency.

Diggsey•1h ago
How does this packing/unpacking scheme compare to just using a lookup table?
zephen•51m ago
I was wondering the same thing.

Obviously, it partly depends on the implementation machine, how big a hole the tables blow in your cache, how fast the multiplies are, etc.

But it probably also hugely depends on the format that you want your trits in. If you use them unpacked, e.g. one trit per byte, then even if you're using tables, you still have to do a lot of manipulation (e.g. either shifting and oring, or having different tables, and a table lookup per trit and adding together to get the binary).

akoboldfrying•29m ago
You can have a single 3x256=768-byte table -- just multiply the input byte by 3 to get the offset into the table, and read out the 3 trits (1 trit per byte) beginning at that offset.

ETA: If you're prepared to waste a byte per entry so that entries are 4 bytes wide, on x86 you can use effective address calculation to do the multiplication for you, letting you decode 3 trits in 1 CPU instruction:

    MOV EAX,[RBX+RCX*4]
zephen•13m ago
There are 5 trits.

In any case, if there were 3 trits, I'm not sure what the practical difference between a single table you describe and 3 different 256 byte tables, again depending on the architecture.

Yes a single table would have better cache effects for a single read, but presumably? you're doing a lot of reads in an unpacking phase.

akoboldfrying•35m ago
Razengan•36m ago
I was actually mucking with ChatGPT about possible "post-binary" architectures.

I ended up feeling that ternary is just icky, because the "middle value" isn't "balanced" by anything.

Maybe we should do what quaternions did to complex numbers and just jump from 2 to 4: Quaternary CPUs

I couldn't understand half of the words it spat out but it turns out that using pairs of "quits" as the atomic computation unit to represent complex numbers and/or 2x2 matrices could be ideal for AI etc.

anagnost•4m ago
I have the opposite feeling: balanced ternary naturally removes the ickiness of twos-complement arithmetic and the unbalanced MIN_INT.
lioeters•36m ago
Amusing that the link to an article on ternary numbers was posted by Mr Triplett. (:

The article is well-written and illustrated. The technique described is used in llama.cpp for running language models like BitNet b1.58 whose weights are stored as ternary types.

> ..in which every single parameter (or weight) of the LLM is ternary {-1, 0, 1}

> significantly more cost-effective in terms of latency, memory, throughput, and energy consumption

The original paper on this technique was published in Feb 2024. (Also linked from the article)

The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits - https://arxiv.org/abs/2402.17764

However, since then there have only been a few other models using ternary weights. I get the impression that there are factors not considered in the paper which make it less practical than it seemed.

zokier•1h ago
I think the key insight here is that 243 is 100000 in base3. So dividing by 243 essentially converts any 5 digit base 3 number to [0,1) interval. Multiplying by 256 converts it to [0,256) interval which conveniently fits into a byte.
marginalia_nu•1h ago
It's kinda remarkable this works given how base 2 and base 3 are incredibly poorly aligned and make for a kind of worst case scenario when it comes to division (e.g. 1/3 = 1/2 - 1/4 + 1/8 - 1/16 + 1/32 ... and 1/2 = 1/3 + 1/9 + 1/27 + 1/81 + ...)
A 256x3=768-byte lookup table will almost certainly be faster on a CPU. It will fit easily in L1 cache, and can extract 3 bytes at a time.

Ironically, x86 has an instruction, XLATB, that does almost exactly this (looking up a byte in a 256-byte table) -- but using it is actually slower than using an equivalent MOVZX RAX,AL; MOV AL,[RBX+RAX] sequence on modern CPUs.