Yanshi 偃师
A headless painting engine: an append-only atom log, a state folded out of that log, a pure-Rust render kernel, a zero-dependency HTTP/WebSocket server, and a minimal web viewer. One kernel compiles natively for the server and to WebAssembly for the browser.
Design stance
- The log is the truth. Every edit is written as an atom and appended to the log; the current state is folded out of it. Undo and redo move a pointer rather than performing the operation backwards.
- One kernel, two places. The optimistic preview while dragging and the final stroke are the same implementation, not two approximations of each other.
- Determinism. The same input gives the same output. Export and replay are guarded by byte-for-byte comparisons.
- Portable by construction. A
.yanshiproject package is an uncompressed tar holding the atom log, the document metadata, every blob the log references, and a HEAD preview rendered at export time. Any system'starcan list and unpack it.
Tool surface
--profile all enables every implemented group in one word: 114 tools, against 46 for core alone. Layer blend modes are validated against the renderer's own list, so an unknown name is refused with the available values instead of being written to the log and silently ignored.
Current state
- Version 0.1.0, with no published release yet. Take the source from GitHub and build the package yourself with
make release, which writes a checksum alongside it. - The
semantictool group is reserved by decision and not implemented. - The paper grain in
appearance.textureapproximates watercolour paper and canvas and is tunable, but there is no dedicated rough-paper or canvas-weave preset. - The browser-side kernel is a build artefact and a fresh clone does not have it. Nothing fails without it: the viewer falls back to server-side rendering. Build it as the README describes to render locally.
Contact
Bug reports and collaboration: yanshi@wangda.today. For security issues, please write to us rather than opening a public issue.
Getting the source
git clone https://github.com/gradetwo/yanshi.git
cd yanshi
make check # format, lint, tests
make release # package: both executables, the browser WASM kernel, the medium plugins
- Repository: github.com/gradetwo/yanshi
- Source download (zip): main.zip
- Design document (authoritative, in Chinese): yanshi-v1.0-draft4.md
- Documentation: README.md | README.zh-CN.md