From 9093d1638b817e477bdfdf9ab8e70ecf24495510 Mon Sep 17 00:00:00 2001 From: ishland Date: Sun, 22 Dec 2024 20:01:06 +0800 Subject: [PATCH] feat: hardforking --- .github/FUNDING.yml | 1 - .github/workflows/build.yml | 31 +++++++++++++ .gitmodules | 3 ++ FlowSched | 1 + README.md | 93 ++++++++++++++----------------------- build.gradle | 2 +- settings.gradle | 2 +- 7 files changed, 71 insertions(+), 62 deletions(-) delete mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/build.yml create mode 100644 .gitmodules create mode 160000 FlowSched diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 233fb1b..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: Spottedleaf \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c029f6a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +# Automatically build the project and run any configured tests for every push +# and submitted pull request. This can help catch issues that only occur on +# certain platforms or Java versions, and provides a first line of defence +# against bad commits. + +name: build +on: [pull_request, push] + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + - name: validate gradle wrapper + uses: gradle/actions/wrapper-validation@v3 + - name: setup jdk 21 + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'microsoft' + - name: build + run: ./gradlew build + - name: capture build artifacts + uses: actions/upload-artifact@v4 + with: + name: Artifacts + path: build/libs/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8132eca --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "FlowSched"] + path = FlowSched + url = https://github.com/RelativityMC/FlowSched.git diff --git a/FlowSched b/FlowSched new file mode 160000 index 0000000..42e2aad --- /dev/null +++ b/FlowSched @@ -0,0 +1 @@ +Subproject commit 42e2aad57ac461e9854850e9eca920afaa7a33fb diff --git a/README.md b/README.md index a2c8095..5066ce5 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,34 @@ -Starlight (Fabric) -== -Fabric mod for completely rewriting the vanilla light engine. - -## Future updates past 1.20 -Please see: https://gist.github.com/Spottedleaf/6cc1acdd03a9b7ac34699bf5e8f1b85c -This project will not receive further updates for the foreseeable future. - -## Download -[CurseForge (Fabric)](https://www.curseforge.com/minecraft/mc-mods/starlight) -[Modrinth (Fabric)](https://modrinth.com/mod/starlight) - -## Contact -[Discord](https://discord.gg/tuinity) - -## Results -~~The graph below shows how much time the light engine was active while generating 10404 chunks:~~ -See "Notice about invalid gen test results" in [TECHNICAL_DETAILS.md](TECHNICAL_DETAILS.md) -for why there is no 1.20 data for this test. - -Below is a graph detailing how long light updates took for breaking/placing -a block on a large platform at y = 254 down to a large platform at y = 0: -![Block update at height graph](https://i.imgur.com/ZQx7Ek0.png) -- Tested via [LightBench](https://github.com/Spottedleaf/lightbench) on 1.20-rc1 -- World is just a flat world with bedrock at y = 0 and grass at y = 254 -- CPU: Ryzen 9 7950X - -Below is a graph detailing light update times for a simple glowstone -place/break: -![Simple glowstone block update](https://i.imgur.com/MrA2PQk.png) -- Tested via [LightBench](https://github.com/Spottedleaf/lightbench) on 1.20-rc1 -- World is just a flat world with bedrock at y = 0 and grass at y = 254 -- CPU: Ryzen 9 7950X -- Tested breaking and placing the glowstone on the bedrock platform, - where skylight could not interfere with the test. - -The results indicate that Starlight is faster for light propagation, but -the absolute times indicate that it is unlikely to affect FPS in any -situation on the client. - -## Purpose -Currently, Starlight's light section management is depended on for both Paper's rewrite -of the chunk system (people in the modding space call this "TACS") and Folia's additional -changes to that system. In Starlight, light sections are tied directly to ChunkAccess objects. - -The light section management prevents most bugs (including performance ones) -involving missing/absent light sections, as Starlight assumes that no updates -are possible unless the chunk exists. This is why there are basically zero performance or bug related -issues with the light section management in Starlight. - -This difference in light section management allows Paper's rewrite of the chunk system (which is designed -as a solid base for [Folia](https://github.com/PaperMC/Folia) to build on, which adds regionized multithreading -to the dedicated server) to greatly simplify and optimize its chunk unload/load logic as it no longer needs to -consider any light engine state as there is no light engine state. - -The "stateless" property of Starlight allows the chunk system to run light updates / generation -in parallel provided the scheduling is done right, see patch "Increase parallelism for neighbour writing chunk statuses" -in 1.19 Folia. This is critical to allowing the chunk system to scale beyond 10 worker threads, -which is important for dedicated servers with more players to stress chunk generation. +# ScalableLux +A Fabric mod based on Starlight that improves the performance of light updates in Minecraft. + +## Why does this fork exist? +- Starlight is no longer maintained as a mod [since Mar 8, 2024](https://github.com/PaperMC/Starlight/commit/cca03d62da48e876ac79196bad16864e8a96bbeb). +- The performance of vanilla lighting engine is still a bottleneck for high-performance chunk generation. +- The base Starlight is still [100% faster than vanilla](), + allowing the chunk system to scale beyond 24 threads. +- Starlight's "stateless" design allows for parallel light updates, further widening the performance gap. + It is still [rather important for dedicated servers with more players to stress chunk generation](https://gist.github.com/Spottedleaf/6cc1acdd03a9b7ac34699bf5e8f1b85c#is-starlight-obsolete). + Therefore, it is still important for Fabric or other modded servers with plenty of players. + +## What does this fork do? +- Contains all the performance improvements from Starlight with additional bug fixes. +- Optionally allows for parallel light updates, bringing significant performance improvement in high-speed + world generation and heavy light updates scenarios. + +## Building and setting up + +#### Initial setup +Run the following commands in the root directory: + +``` +git submodule update --init +./build.sh up +./build.sh patch +``` + +#### Creating a patch +See [CONTRIBUTING.md](CONTRIBUTING.md) for more detailed information. + + +#### Compiling +Use the command `./build.sh build`. Compiled jars will be placed under `Starlight-Patched/build/libs/`. diff --git a/build.gradle b/build.gradle index ed6d51b..a5fedcd 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ def getGitCommit = { -> exec { commandLine 'git', 'rev-parse', '--short', 'HEAD' standardOutput = stdout - workingDir = ".." +// workingDir = ".." } return stdout.toString().trim() } diff --git a/settings.gradle b/settings.gradle index 72ebf6e..59b33fb 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,7 +11,7 @@ pluginManagement { rootProject.name = "ScalableLux" -includeBuild('../FlowSched') { +includeBuild('FlowSched') { dependencySubstitution { substitute module('com.ishland.flowsched:flowsched') using project(':') }