{"id":14225599,"url":"https://github.com/mkeeter/fidget","last_synced_at":"2025-05-16T04:07:10.502Z","repository":{"id":65366308,"uuid":"507165973","full_name":"mkeeter/fidget","owner":"mkeeter","description":"blazing fast implicit surface evaluation","archived":false,"fork":false,"pushed_at":"2025-05-07T12:49:26.000Z","size":3872,"stargazers_count":333,"open_issues_count":15,"forks_count":23,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-07T13:42:13.915Z","etag":null,"topics":["computer-graphics","frep","implicit-surfaces","jit","rendering"],"latest_commit_sha":null,"homepage":"https://mattkeeter.com/projects/fidget","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkeeter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-24T23:12:47.000Z","updated_at":"2025-05-07T12:49:29.000Z","dependencies_parsed_at":"2023-12-31T15:30:36.339Z","dependency_job_id":"ecd5f57c-3e04-4826-8132-9a75ad26bb70","html_url":"https://github.com/mkeeter/fidget","commit_stats":{"total_commits":856,"total_committers":2,"mean_commits":428.0,"dds":0.002336448598130869,"last_synced_commit":"279a56a9d048a1c8632b78429b43217365bfa375"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkeeter%2Ffidget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkeeter%2Ffidget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkeeter%2Ffidget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkeeter%2Ffidget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkeeter","download_url":"https://codeload.github.com/mkeeter/fidget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464897,"owners_count":22075571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-graphics","frep","implicit-surfaces","jit","rendering"],"created_at":"2024-08-20T01:01:24.110Z","updated_at":"2025-05-16T04:07:05.489Z","avatar_url":"https://github.com/mkeeter.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Fidget\n[![» Crate](https://badgen.net/crates/v/fidget)](https://crates.io/crates/fidget)\n[![» Docs](https://badgen.net/badge/api/docs.rs/df3600)](https://docs.rs/fidget/)\n[![» CI](https://badgen.net/github/checks/mkeeter/fidget/main)](https://github.com/mkeeter/fidget/actions/)\n[![» MPL-2.0](https://badgen.net/github/license/mkeeter/fidget)](LICENSE.txt)\n\n[Project writeup](https://mattkeeter.com/projects/fidget) | [Demo](https://mattkeeter.com/projects/fidget/demo)\n\nFidget is experimental infrastructure for complex closed-form implicit surfaces.\n\n[![screenshot of web editor](demos/web-editor/screenshot.png)](https://mattkeeter.com/projects/fidget/demo)\n\nThe library contains a variety of data structures and algorithms, e.g.\n\n- Manipulation and deduplication of math expressions\n- Conversion from graphs into straight-line code (\"tapes\") for evaluation\n- Tape simplification, based on interval evaluation results\n- A _very fast_ JIT compiler, with hand-written `aarch64` and `x86_64` routines\n  for\n    - Point-wise evaluation (`f32`)\n    - Interval evaluation (`[lower, upper]`)\n    - SIMD evaluation (`f32 x 4` on ARM, `f32 x 8` on x86)\n    - Gradient evaluation (partial derivatives with respect to x, y, and z)\n- Bitmap rendering of implicit surfaces in 2D (with a variety of rendering\n  modes) and 3D (producing heightmaps and normals)\n- Meshing (using our own implementation of the\n  [Manifold Dual Contouring](https://people.engr.tamu.edu/schaefer/research/dualsimp_tvcg.pdf)\n  algorithm)\n\nIf this all sounds oddly familiar, it's because you've read\n[Massively Parallel Rendering of Complex Closed-Form Implicit Surfaces](https://www.mattkeeter.com/research/mpr/).\nFidget includes all of the building blocks from that paper, but with an emphasis\non (native) evaluation on the CPU, rather than (interpreted) evaluation on the\nGPU.\n\nThe library has [extensive documentation](https://docs.rs/fidget/latest/fidget/),\nincluding a high-level overview of the APIs in the crate-level docs; this is a\ngreat place to get started!\n\nAt the moment, it has strong Lego-kit-without-a-manual energy: there are lots of\nfunctions that are individually documented, but putting them together into\nsomething useful is left as an exercise to the reader.  There may also be some\nmissing pieces, and the API seams may not be in the right places; if you're\ndoing serious work with the library, expect to fork it and make local\nmodifications.\n\nIssues and PRs are welcome, although I'm unlikely to merge anything which adds\nsubstantial maintenance burden.  This is a personal-scale experimental project,\nso adjust your expectations accordingly.\n\n## Demos\nThe [`demos` folder](demos/README.md) contains several demo tools and\napplications built using the Fidget crate,\nranging from CLI to GUI to web app.\n\n## Support matrix\nAt the moment, Fidget supports a limited number of platforms:\n\n| Platform                    | JIT support | CI         | Support   |\n|-----------------------------|-------------|------------|-----------|\n| `aarch64-apple-darwin`      | Yes         | ✅ Tested  | ⭐️ Tier 0 |\n| `x86_64-unknown-linux-gnu`  | Yes         | ✅ Tested  | 🥇 Tier 1 |\n| `x86_64-pc-windows-msvc`    | Yes         | ✅ Tested  | 🥈 Tier 2 |\n| `aarch64-unknown-linux-gnu` | Yes         | ⚠️  Checked | 🥇 Tier 1 |\n| `aarch64-pc-windows-msvc`   | Yes         | ⚠️  Checked | 🥉 Tier 3 |\n| `wasm32-unknown-unknown`    | No          | ⚠️  Checked | 🥇 Tier 1 |\n\n### Explanation of keys\n| CI         | Description                               |\n|------------|-------------------------------------------|\n| ✅ Tested  | `cargo test` is run for the given target  |\n| ⚠️  Checked | `cargo check` is run for the given target |\n\n| Tier      | Description                                                                    |\n|-----------|--------------------------------------------------------------------------------|\n| ⭐️ Tier 0 | A maintainer uses this platform as their daily driver                          |\n| 🥇 Tier 1 | A maintainer has access to this platform                                       |\n| 🥈 Tier 2 | A maintainer does not have access to this platform, but it is tested in CI     |\n| 🥉 Tier 3 | A maintainer does not have access to this platform, and it is not tested in CI |\n\nSupport tiers represent whether maintainers will be able to help with\nplatform-specific bugs; for example, if you discover an\n`aarch64-pc-windows-msvc`-specific issue, expect to do most of the heavy lifting\nyourself.\n\n### CPU requirements\n`aarch64` platforms require NEON instructions and `x86_64` platforms require\nAVX2 support; both of these extensions are nearly a decade old and should be\nwidespread.\n\nDisabling the `jit` feature allows for cross-platform rendering, using an\ninterpreter rather than JIT compilation.  This is mandatory for the\n`wasm32-unknown-unknown` target, which cannot generate \"native\" code.\n\n## Similar projects\nFidget overlaps with various projects in the implicit modeling space:\n\n- [kokopelli: script-based CAD/CAM in Python](https://mattkeeter.com/projects/kokopelli)*\n- [Antimony: CAD from a parallel universe](https://mattkeeter.com/projects/antimony)*\n- [`libfive`: Infrastructure for solid modeling](https://libfive.com)*\n- [Massively Parallel Rendering of Complex Closed-Form Implicit Surfaces (MPR)](https://github.com/mkeeter/mpr)*\n- [ImplicitCAD: Powerful, Open-Source, Programmatic CAD](https://implicitcad.org/)\n- [Ruckus: Procedural CAD For Weirdos](https://docs.racket-lang.org/ruckus/index.html)\n- [Curv: a language for making art using mathematics](https://github.com/curv3d/curv)\n- [sdf: Simple SDF mesh generation in Python](https://github.com/fogleman/sdf)\n- [Forged Thoughts: A Modeling \u0026 Rendering Language in Rust](https://forgedthoughts.com/)\n- [Raumkuenstler: Node-based modeling with an LLVM-powered JIT compiler](https://github.com/elisabeth96/Raumkuenstler)\n- [`saft_sdf`: Signed distance field function utilities and interpreter](https://docs.rs/saft-sdf/0.2.1/saft_sdf/)\n- Probably more; PRs welcome!\n\n*written by the same author\n\n(the MPR paper also cites\n[many references](https://dl.acm.org/doi/10.1145/3386569.3392429#sec-ref)\nto related academic work)\n\nCompared to these projects, Fidget is unique in having a native JIT **and**\nusing that JIT while performing tape simplification.  Situating it among\nprojects by the same author – which all use roughly the same rendering\nstrategies – it looks something like this:\n\n|                 | CPU               | GPU\n|-----------------|-------------------|------\n| **Interpreter** | `libfive`, Fidget | MPR\n| **JIT**         | Fidget            | (please give me APIs to do this)\n\nFidget's native JIT makes it _blazing fast_.\nFor example, here are rough benchmarks rasterizing [this model](https://www.mattkeeter.com/projects/siggraph/depth_norm@2x.png)\nacross three different implementations:\n\nSize  | `libfive` | MPR     | Fidget (VM) | Fidget (JIT)\n------|-----------|---------|-------------|---------------\n1024³ | 66.8 ms   | 22.6 ms | 61.7 ms     | 23.6 ms\n1536³ | 127 ms    | 39.3 ms | 112 ms      | 45.4 ms\n2048³ | 211 ms    | 60.6 ms | 184 ms      | 77.4 ms\n\n`libfive` and Fidget are running on an M1 Max CPU; MPR is running on a GTX 1080\nTi GPU.  We see that Fidget's interpreter is slightly better than `libfive`, and\nFidget's JIT is _nearly_ competitive with the GPU-based MPR.\n\nFidget is missing a bunch of features that are found in more mature projects.\nFor example, it only includes a debug GUI, and its meshing is much less\nbattle-tested than `libfive`.\n\n## License\n© 2022-2025 Matthew Keeter  \nReleased under the [Mozilla Public License 2.0](https://github.com/mkeeter/fidget/blob/main/LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkeeter%2Ffidget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkeeter%2Ffidget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkeeter%2Ffidget/lists"}