From 29daaf6be063120e2e3094d13864cdc669bc7d15 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 9 Jul 2026 15:06:24 +0000 Subject: [PATCH 1/2] fix: bypass AsyncCatcher in CullTask entity iteration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ServerLevel.getEntities() fires AsyncCatcher.catchOp() before returning the (actually thread-safe) EntityLookup. Use ChunkSystemLevel.moonrise() directly to access the Moonrise entity lookup from async threads — same pattern used by other background task patches (0286-fast-bit-radix-sort.patch). Fixes IllegalStateException spam in Leaf Raytrace Tracker thread. --- .../src/main/java/dev/tr7zw/entityculling/CullTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/leaf-server/src/main/java/dev/tr7zw/entityculling/CullTask.java b/leaf-server/src/main/java/dev/tr7zw/entityculling/CullTask.java index ddda0828..c502e0e4 100644 --- a/leaf-server/src/main/java/dev/tr7zw/entityculling/CullTask.java +++ b/leaf-server/src/main/java/dev/tr7zw/entityculling/CullTask.java @@ -3,6 +3,8 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.logisticscraft.occlusionculling.OcclusionCullingInstance; import com.logisticscraft.occlusionculling.util.Vec3d; +import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel; +import ca.spottedleaf.moonrise.patches.chunk_system.level.entity.EntityLookup; import dev.tr7zw.entityculling.versionless.access.Cullable; import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.ints.IntSets; @@ -126,7 +128,8 @@ public synchronized void run() { } private void cullEntities(Vec3 cameraMC, Vec3d camera) { - for (Entity entity : this.checkTarget.level().getEntities().getAll()) { // This one's safe here; moonrise returns an array for us to iterate + EntityLookup entityLookup = ((ChunkSystemLevel) this.checkTarget.level()).moonrise$getEntityLookup(); + for (Entity entity : entityLookup.getAll()) { if (!(entity instanceof Cullable cullable) || entity == this.checkTarget) { continue; } From dbd3c0339c93c2cda9fc57a737ea978f582587ab Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 11 Aug 2026 23:26:33 +0000 Subject: [PATCH 2/2] fix: harden upstream-watch jq (broken pipe + invalid backtick escape) Same bug that broke the monorepo watch: 'jq ... | head -N' under pipefail fails with 'jq: writing output failed: Broken pipe' when head closes the pipe early, and the filelist used a backslash-backtick which jq rejects as an invalid escape. Move truncation inside jq (.[:30], split on newline) and drop the backtick backslashes. This was failing every scheduled run on Fuji (e.g. 15:02/17:01/19:08). --- .github/workflows/upstream-watch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upstream-watch.yml b/.github/workflows/upstream-watch.yml index c96165a0..27265c0d 100644 --- a/.github/workflows/upstream-watch.yml +++ b/.github/workflows/upstream-watch.yml @@ -46,7 +46,7 @@ jobs: commit=$(gh api "repos/$REPO/commits/$BRANCH") sha=$(jq -r '.sha' <<<"$commit") short=${sha:0:7} - msg=$(jq -r '.commit.message' <<<"$commit" | head -1) + msg=$(jq -r '.commit.message | split("\n")[0]' <<<"$commit") titlemsg=$(printf '%s' "$msg" | cut -c1-60) author=$(jq -r '.commit.author.name' <<<"$commit") date=$(jq -r '.commit.author.date' <<<"$commit") @@ -79,7 +79,7 @@ jobs: del=$(jq -r '[.files[]?.deletions] | add // 0' <<<"$cmp") nfiles=$(jq -r '[.files[]?] | length' <<<"$cmp") stats="**$ncommits** commit(s) · **$nfiles** file(s) · **+$add / -$del**" - filelist=$(jq -r '.files[]? | "- `\(.status)` `\(.filename)` (+\(.additions)/-\(.deletions))"' <<<"$cmp" | head -30) + filelist=$(jq -r '[.files[]? | "- `\(.status)` `\(.filename)` (+\(.additions)/-\(.deletions))"] | .[:30] | join("\n")' <<<"$cmp") fi # Build the issue body