惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Stack Overflow Blog
Stack Overflow Blog
量子位
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
S
SegmentFault 最新的问题
A
About on SuperTechFans
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
G
Google Developers Blog
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
雷峰网
雷峰网
罗磊的独立博客
Vercel News
Vercel News
L
LangChain Blog
V
V2EX
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
博客园 - Franky
V
Visual Studio Blog
J
Java Code Geeks

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - tbmo/mog-solver: Fast, memory-efficient N-body g...
tbmo · 2026-05-09 · via Hacker News: Show HN

Emergent Spiral Galaxies (click image for video)

A GPU-accelerated N-body gravity simulator using the Mixture of Grids (MOG) algorithm.

The Algorithm

Traditional particle-mesh (PM) gravity solvers face a fundamental tradeoff: a single coarse grid is fast but produces blind spots (particles in the same cell exert no force on each other) and grid-aligned artifacts. A fine grid fixes this but memory and compute scale cubically with resolution — prohibitive in 3D.

MOG solves this by averaging forces across an ensemble of independently rotated and offset coarse grids. Particles that share a cell on one grid are separated on others. The ensemble average recovers sub-cell force resolution and eliminates grid artifacts, at a fraction of the memory cost of an equivalent fine grid.

Key insight

Think of two tic-tac-toe boards, one offset so its gridlines subdivide the other's cells. You have 18 real cells (2 × 3²) but effective sampling coverage of 36 (6²). Each additional grid multiplies effective resolution in each dimension but only adds linearly to memory.

In 3D with k grids of resolution g:

Quantity Expression Example (k=240, g=16)
Real cells k × g³ 983,040
Equivalent fine grid (k × g)³ 90.2 billion
Memory savings ~92,000×

Why rotations matter

Offsets alone still leave directional blind spots — diagonal particle pairs are harder to resolve than axis-aligned ones. Random rotations break this symmetry. Each grid samples a different orientation of space, so the ensemble force is isotropic and free of grid-aligned artifacts regardless of particle configuration.

Pipeline

For each grid i in [0, k):
  1. Rotate + offset particle positions into grid i's local frame
  2. Scatter mass to nearest grid point (NGP, atomic add)
  3. FFT → multiply by Green's function → IFFT → force field
  4. Sample force at particle's local position
  5. Rotate force back to world space

Average forces across all k grids
Update velocities and positions (leapfrog integration)

Results

MOG resolves ring and shell galaxy morphologies at scales well below a single coarse cell width. No grid-aligned artifacts are present despite each individual grid being only 16³.

See the accompanying paper for force accuracy measurements and memory scaling analysis.

Requirements

  • Python 3.8+
  • OpenGL 4.6 capable GPU
  • numpy, moderngl, moderngl-window, pyyaml

Usage

pip install numpy moderngl moderngl-window pyyaml
python main.py

Controls

Key Action
Mouse drag Rotate camera
Scroll Zoom
Space Pause / resume
R Reset particles (Perlin noise)
T Reset as two colliding galaxies
1 / 2 / 3 Clustering presets
G Toggle grid debug overlay
H Toggle particle rendering
C Toggle FFT / convolution solver
[ / ] Decrease / increase timescale
\ Reverse time
Q Quit

Configuration

Edit config.yaml:

n_grids: 240        # Number of grids in the ensemble
grid_size: 16       # Resolution per grid (16³)
world_size: 100.0   # Simulation domain size
num_particles: 1e6  # Particle count
G: 100.0            # Gravitational constant
dt: 0.00001         # Time step
solver: fft         # "fft" or "convolution"
damping: 0.999      # Velocity damping per step

Complexity

Approach Memory Time per step
Direct N-body O(n) O(n²)
Single PM grid O(g³) O(g³ log g)
MOG O(k·g³) O(n·k + k·g³ log g)

Citation

If you use this code, please cite the accompanying paper:

Thomas Bailey (2026). Mixture of Grids (MOG): A Linear-Scaling Particle-Mesh
Poisson Solver via Ensemble Grid Averaging. 

here