Add eForth raytracer showcase - #17
Merged
Merged
Conversation
tests/raytracer.fth runs on the baked 32-bit eForth and raytraces two spheres over a checkerboard with shadow rays and half-Lambert + Phong shading, streaming one deterministic 64x32 RGB888 PNG to stdout via the svpng stored-block technique (quadratic ray-sphere intersection, a bitwise isqrt, CRC32 from a 16-entry nibble table, Adler32, one uncompressed DEFLATE block per scanline). The substrate is the unmodified build/muxleq driven by stdin: no VM, CLI, or MMIO change. Arithmetic is integer-only 16.16 fixed point (rescaled x256 from nand2raytrace's 8.8), so the output is byte-stable across runs and machines. It is also portable across Forth implementations: the same source runs on gforth and emits the identical 6399-byte PNG. The CRC folds are masked to 32 bits (a no-op on muxleq's 32-bit cell) and the prompt/warning setup lines are guarded with `defined ... [if]` so gforth skips what it lacks. The golden-raytracer target byte-compares the render against tests/expected/raytracer.png. It stays standalone rather than in the fast check gate, since one frame is a few minutes of pure-eForth interpretation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/raytracer.fth runs on the baked 32-bit eForth and raytraces two spheres over a checkerboard with shadow rays and half-Lambert + Phong shading, streaming one deterministic 64x32 RGB888 PNG to stdout via the svpng stored-block technique (quadratic ray-sphere intersection, a bitwise isqrt, CRC32 from a 16-entry nibble table, Adler32, one uncompressed DEFLATE block per scanline). The substrate is the unmodified build/muxleq driven by stdin: no VM, CLI, or MMIO change.
Arithmetic is integer-only 16.16 fixed point (rescaled x256 from nand2raytrace's 8.8), so the output is byte-stable across runs and machines. It is also portable across Forth implementations: the same source runs on gforth and emits the identical 6399-byte PNG. The CRC folds are masked to 32 bits (a no-op on muxleq's 32-bit cell) and the prompt/warning setup lines are guarded with
defined ... [if]so gforth skips what it lacks.The golden-raytracer target byte-compares the render against tests/expected/raytracer.png. It stays standalone rather than in the fast check gate, since one frame is a few minutes of pure-eForth interpretation.
Summary by cubic
Adds a deterministic eForth raytracer showcase and a
golden-raytracerMakefile target that verifies the PNG output byte‑for‑byte. It renders a 64x32 RGB888 frame to stdout using the unmodifiedbuild/muxleqinterpreter.tests/raytracer.fth: 16.16 fixed‑point raytracer (two spheres, checkerboard, shadows, half‑Lambert + Phong).build/muxleqandgforth.golden-raytracer(respectsRAYTRACE_TIMEOUT, default 600s; warns if notimeout) that byte‑compares againsttests/expected/raytracer.png; excluded fromcheckdue to multi‑minute runtime.Written for commit 0227c87. Summary will update on new commits.