Skip to content

new: lithostitched support (dfc opts) - #571

Merged
ishland merged 59 commits into
RelativityMC:dev/26.2.0from
ebo2022:feature/litho-integration
Aug 12, 2026
Merged

new: lithostitched support (dfc opts)#571
ishland merged 59 commits into
RelativityMC:dev/26.2.0from
ebo2022:feature/litho-integration

Conversation

@ebo2022

@ebo2022 ebo2022 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This pull request currently adds AST conversion and bytecode/dot/OCL emitters for all Lithostitched dfs except FastNoiseDensityFunction. Eventually, it will also include natives accel for FastNoiseDensityFunction (using the C port of FastNoiseLite) and OpenCL accel support for the region system & biome injectors.

Leaving as a draft while I work on this. Please let me know if I should keep this as a separate addon, or if it's better fit to implement on Lithostitched's side. Otherwise, I'll keep this here for feedback; once done, I'll convert to a regular PR and provide benchmarks + compat tests.

@ishland

ishland commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR. However the project currently don't accept contributions to the OpenCL subproject due to licensing until we figure out how to properly accept contributions to it. And I would like to change how codegen works inside that subproject at some point as well.

Other changes seems good from the first glance. A few problems:

  • The new AST nodes shouldn't be guarded behind the availability of the bindings.
  • The builtin integrations detection in McToAst doesn't really scale. I'm considering a refactor on that part as well.

I think compatibility with lithostitched should ideally be provided by C2ME, since there's currently no stable API, and providing a stable API for a compiler backend isn't trivial.

@ebo2022

ebo2022 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback and update.

Regarding OCL accel: Haven't decided yet, but I'll either keep the changes and wait, or split that subproject into a later PR once licensing is figured out and contributions open.

I'll go ahead and fix the guarding. For integrations handling, I may use a CodeGenRegistry & emitters (slight refactor to generalize the emitters to support dfs -> ast nodes) for now. I won't touch that any further until I see how you refactor it. I don't expect this to be done for quite a while.

@ebo2022

ebo2022 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Narrowing the scope of this PR to non-OpenCL subprojects. At some point, I'll split those changes into another draft PR that can stay open until licensing is figured out.

@ebo2022 ebo2022 changed the title new: lithostitched support new: lithostitched support (non-ocl subprojects) Jul 11, 2026
@ebo2022

ebo2022 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Fast Noise Benchmark Results

CPU: AMD Ryzen 5 3600x
GPU: Nvidia RTX 3060 Ti
16GB DDR4 RAM

Performance impact seems to vary wildly depending on noise type, so the natives accel can be cut if deemed unnecessary

Misc datapacks for parity testing:
c2me-test-perlin-simplex-select-cos.zip
c2me-test-shift.zip
c2me-test-sin-axis-sqrt.zip
c2me-test-fastnoise-cellular.zip

@CLAassistant

CLAassistant commented Jul 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ebo2022 ebo2022 changed the title new: lithostitched support (non-ocl subprojects) new: lithostitched support Jul 29, 2026
@ebo2022
ebo2022 marked this pull request as draft July 29, 2026 15:50
@ebo2022
ebo2022 marked this pull request as ready for review July 29, 2026 15:54
@ebo2022
ebo2022 marked this pull request as draft July 29, 2026 16:02
@ebo2022 ebo2022 changed the title new: lithostitched support new: lithostitched support (dfc opts) Jul 29, 2026
@ebo2022
ebo2022 marked this pull request as ready for review July 29, 2026 23:48

@ishland ishland left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. A few problems:

Comment thread c2me-opts-natives-math/src/main/resources/c2me-opts-natives-math.mixins.json Outdated
@ishland
ishland self-requested a review August 3, 2026 13:06
ebo2022 and others added 4 commits August 4, 2026 21:45
…-integration

# Conflicts:
#	c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ast/McToAst.java
#	c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/gen/dot/DotGenRegistry.java
#	c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/gen/jvm/BytecodeGenRegistry.java
@ishland
ishland merged commit 62a21e7 into RelativityMC:dev/26.2.0 Aug 12, 2026
4 checks passed
ishland added a commit that referenced this pull request Aug 12, 2026
* new - setup package structure for lithostitched bindings; handle AxisDensityFunction

* fix: missing license header for AxisBindings

* new: handle unary lithostitched dfs

* refactor: move lithostitched unary nodes to separate subpackage

* refactor (again): keep all lithostitched nodes in integration pkg

* new: individual binding checks for registering emitters

* new - setup package structure for lithostitched bindings; handle AxisDensityFunction

* fix: missing license header for AxisBindings

* new: handle unary lithostitched dfs

* refactor: move lithostitched unary nodes to separate subpackage

* refactor (again): keep all lithostitched nodes in integration pkg

* new: individual binding checks for registering emitters

* new: handle SelectDensityFunction with linear search node

* new: handle MixDensityFunction

* new: handle ShiftDensityFunction

* new: first pass at fast noise bindings & memory struct

* refactor: remove guarding on ast node registration

* rollback: remove ocl integration content

* fix: missing license header

* fix: switch lithostitched jvm emitters to DfcObjectCache

* new: natives accel for FastNoiseDensityFunction

* fix: missing bindings template method handles

* new: FastNoise dot and jvm emitters

* refactor: use switch statement for builtin integrations

* fix: license headers

* Revert "refactor: use switch statement for builtin integrations"

This reverts commit 98d23e3.

* refactor: migrate bindings to dfc frontend registry

* fix: use reflection for shadow fields unresolvable by mixin

* fix: exception messages in bindings classes

* fix: delay FNLState init until lithostitched binds world seed

* new: fnl benchmark

* change: 64 bit alignment fnl arrays

* mirror: table dot gen for SelectNode

* fix: exempt FastNoiseLite from license header

* fix: license header

* mirror: promote FNL to natives after 64k samples

* fix: casting

* fix: ShiftNode bytecode local var indices

* change: separate header file for FNL

* refactor: move generic unary nodes to main package

* fix: whitespace

* refactor: move fnl access fully to bindings

* fix: trailing comma

* fix: reset ShiftNode emitter EvalType to NORMAL

* disable: fnl natives accel

* fix: guard TrackingVH assignment

* Revert "fix: reset ShiftNode emitter EvalType to NORMAL"

This reverts commit ceb3bca.

* re-fix: reset ShiftNode emitter EvalType to NORMAL

* fix: unused import

* update: match new method def format

* chore: cleanups

* change: disable unused FNL natives to reduce jar size

---------

Co-authored-by: ishland <30385023+ishland@users.noreply.github.com>
(cherry picked from commit 62a21e7)
ishland added a commit that referenced this pull request Aug 13, 2026
Upstream has released updates that appear to apply and compile correctly

Upstream Changes:
607e699 new: lithostitched support (dfc opts) (#571)
1277fad fix: remove prioritization selection on nvidia and platforms
c3a6ae7 change: emit chunky.maxWorkingCount for heap sizes larger than 10G
030d0e1 new: workaround NVIDIA_LINUX_HANG_ON_TOO_MANY_BATCHES
92861d0 change: move device whitelist and blacklist before prioritization
3ff5525 Merge feat/dfc-overhaul-v2
79be1a7 fix: delay block entity loading for delayFullChunkEvents
88d32ad fix: apply behavior in delegate nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants