HackerTrans
TopNewTrendsCommentsPastAskShowJobs

graphpilled

no profile record

Submissions

Show HN: Neural network compiler targeting WebGPU – runs in browser

graphpilled.github.io
2 points·by graphpilled·5 months ago·1 comments

Show HN: Fine-tuned Qwen2.5-7B on 100 films for probabilistic story graphs

cinegraphs.ai
101 points·by graphpilled·5 months ago·20 comments

[untitled]

18 points·by graphpilled·6 months ago·0 comments

comments

graphpilled
·5 months ago·discuss
Hi HN, I've been obsessed with the idea of visual ML model building since mid-2024. I experimented with a bunch of approaches: Three.js to PyTorch, a Three.js to OCaml compiler with a custom Lisp-inspired IR targeting CUDA. None of them felt right, so I paused to work on other projects. In December I rethought the whole approach. Instead of targeting CUDA (which requires a server), I asked: what if the entire compiler ran in the browser? WebGPU had matured enough that it seemed possible. So I built this. ReScript compiles to JavaScript and generates WGSL compute shaders. I defined 208 operations as algebraic types, wrote a shape inference engine with broadcasting and convolution rules, and built a codegen module (3500+ lines) that emits optimized WGSL for every op. The compiler handles topological sorting, buffer allocation, and dispatch scheduling. Autograd generates backward kernels for each differentiable operation. No server, no ONNX runtime—just your browser and GPU. The demo is a 3D block builder where you drag layers onto a canvas and watch four code views update live: the high-level nn.js API, the ReScript compiler graph, the raw WGSL shaders, and the dispatch table. You can load preset architectures (CNN, Transformer, Autoencoder, LSTM) or build your own. What I'm most pleased with is the INT4 quantized matmul—column-major weight layout for coalesced reads, vec4 dot products, per-group dequantization. I got Qwen 2.5 7B running entirely in-browser at decent speed even on my crappy used ThinkPad. Source: https://github.com/graphpilled/visual-web-ai Try it out and tell me what you think.
graphpilled
·5 months ago·discuss
That's a cool setup. An API that returns the branching structure as JSON would fit your use case well—you'd feed in a prompt, get back the graph, and integrate it into your knowledge tree however you want.

I'll keep this in mind as I plan the API. If you want to stay in touch, I just created an X account—it's on my HN profile.
graphpilled
·5 months ago·discuss
That's wild. Hard to say for sure—could be that your scenario's structure pattern-matched something in Qwen's training data, or it picked up on implicit episodic cues in your writing. The base model has seen a lot of serialized content. What was the original scenario about?
graphpilled
·5 months ago·discuss
Interesting use case. I don't have a public API yet, but it's something I'd consider if there's demand. What kind of integration are you imagining—feeding prompts in and getting branches back, or something else?
graphpilled
·5 months ago·discuss
The Oblique Strategies comparison is exactly the vibe I was going for—generative constraints that open up possibilities rather than closing them down. Node editing is the top priority right now. You're right that the loop isn't complete without it.
graphpilled
·5 months ago·discuss
Good point—you're right, there should be a way to mark a branch as an endpoint instead of forcing more branches. Adding that to the list. Thanks.
graphpilled
·5 months ago·discuss
Not yet, but both are on the roadmap. Manual node editing is the next priority—letting you tweak branches or add your own directions.

The script evaluation idea is interesting—you're not the first to suggest it. The extraction pipeline already identifies structural elements like scene mirroring and character arc inversions, so exposing that as an analysis tool isn't a huge leap. Definitely something I want to explore.
graphpilled
·5 months ago·discuss
Thanks for flagging that—the node overlap issue is a known bug when the graph gets dense. I'm working on better auto-layout. Appreciate the report.
graphpilled
·5 months ago·discuss
There's a demo on the landing page that walks through it. Basically you input any idea—no matter how vague—and the system generates branching directions you could take it. You explore the branches, and when you're satisfied you can export and the system generates a technical screenplay based on your choices. There's no "right" first prompt—I've thrown some of my dumbest ideas at it just to see where the system takes me. That's kind of the point. Regarding adding your own branches—yes, that's on my roadmap. Letting users create their own options and shape the graph more directly. Still a work in progress!
graphpilled
·5 months ago·discuss
Thanks! Here's the full list: 2001: A Space Odyssey, 8½, Aguirre the Wrath of God, Ali: Fear Eats the Soul, All That Heaven Allows, Apocalypse Now, Ashes and Diamonds, A Woman Under the Influence, Barry Lyndon, Bicycle Thieves, Breathless, Casablanca, Céline and Julie Go Boating, Chinatown, Chinese Roulette, Citizen Kane, City Lights, City of Pirates, Contempt, Daisies, Damnation, Dishonored, Earth, Electra My Love, El Topo, Eraserhead, Eyes Wide Shut, Film Socialisme, Fitzcarraldo, Fuego en Castilla, Hiroshima Mon Amour, Holy Motors, Inauguration of the Pleasure Dome, In a Year with 13 Moons, India Song, Inland Empire, Irma Vep, Koyaanisqatsi, La Dolce Vita, La Jetée, Late Spring, L'Eau de la Seine, Le Voyage dans la Lune, Lolita, Los Olvidados, Lost Highway, Lucifer Rising, Man with a Movie Camera, Metropolis, Mirror, Mulholland Drive, Night Music, Ordet, Orpheus, Persona, Pickpocket, Playtime, Psycho, Rebecca, Rosemary's Baby, Rumble Fish, Scarface, Seven Samurai, Sherlock Jr., Singin' in the Rain, Stalker, Sunset Boulevard, Taste of Cherry, Taxi Driver, Testament of Orpheus, The 400 Blows, The Blood of a Poet, The Cabinet of Dr. Caligari, The Color of Pomegranates, The Green Ray, The Holy Mountain, The Isle, The Lady from Shanghai, The Night of the Hunter, The Passion of Joan of Arc, The Seventh Seal, The Spirit of the Beehive, The Tales of Hoffmann, The Tree of Life, The Turin Horse, Time of the Gypsies, Tokyo Story, Touch of Evil, Trans-Europ-Express, Ugetsu, Un Chien Andalou, Uncle Boonmee Who Can Recall His Past Lives, Vampyr, Videodrome, Wavelength, Werckmeister Harmonies, Wild Strawberries, Moonlight Sonata, Stellar, The Haunted House Biased toward European art cinema, experimental work, and directors who broke conventional narrative rules.
graphpilled
·6 months ago·discuss
Good point! Here's a quick demo showing how it works: https://www.youtube.com/watch?v=b66ZHznBvEM
graphpilled
·6 months ago·discuss
Hi HN, I'm a computer systems engineering student in Mexico who switched from film school. I built CineGraphs because my filmmaker friends and I kept hitting the same wall—we'd have a vague idea for a film but no structured way to explore where it could go. Every AI writing tool we tried output generic, formulaic slop. I didn't want to build another ChatGPT wrapper, so I went a different route. The idea is simple: you input a rough concept, and the tool generates branching narrative paths visualized as a graph. You can then sculpt those branches into a structured screenplay format and export to Fountain for use in professional screenwriting software. For the training data, I spent a month curating 100 films I consider high-quality cinema—Godard, Kurosawa, Brakhage, and others. I built a 1000+ line extraction pipeline using Qwen3-VL to pull narrative structure, characters, and themes from each film with subtitles enabled. From those extractions I generated a 10K example dataset and fine-tuned Qwen2.5-7B-Instruct with a LoRA optimized for probabilistic story branching. The graph visualization is built with React Flow. We've been using it ourselves to break through second-act problems and explore narrative directions we wouldn't have considered otherwise. The branching format forces you to think in possibilities rather than committing too early. You can try it at https://cinegraphs.ai/ — the free tier gives you 3 projects. Would love feedback on the generation quality and whether the graph interface feels intuitive for your workflow.