Skip to content

new: lithostitched support (dfc opts) - #571

Open
ebo2022 wants to merge 58 commits into
RelativityMC:dev/26.2.0from
ebo2022:feature/litho-integration
Open

new: lithostitched support (dfc opts)#571
ebo2022 wants to merge 58 commits into
RelativityMC:dev/26.2.0from
ebo2022:feature/litho-integration

Conversation

@ebo2022

@ebo2022 ebo2022 commented Jul 10, 2026

Copy link
Copy Markdown

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
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
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
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
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ebo2022
❌ ishland
You have signed the CLA already but the status is still pending? Let us recheck it.

@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
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