Skip to content

Commit e51227a

Browse files
TheMeinerLPclaude
andauthored
docs(light): correct two javadoc claims the code stopped supporting (#37)
Both were flagged in the wiki as open items. Neither is a wording problem. FalcoLightingChunk said "Three overrides, and every one of them only reports something to the scheduler". There are five, and two of them report nothing to the scheduler: invalidate drops the cached light packet, and onLightUpdated drops it and sends a fresh one to the viewers. The claim the paragraph exists to make — that the class holds no computation logic — is true and now rests on what the class actually contains. AreaVsPerChunkBenchmark said the chunks are "rebuilt per iteration so neither side benefits from the light the other one left behind". The second half is right, and for a different reason than stated: JMH gives each measured method its own trial, so area() and perChunk() never share chunks. The first half is wrong — @setup is Level.Trial, so within one trial the chunks are not rebuilt at all, and since both methods write light into them, every iteration after the first re-lights already lit chunks. Whether that moves the number is untested and now says so rather than being asserted either way. Raising the setup to Level.Iteration would answer it and would also leave the configuration the published table was measured under, so it is not something to change while fixing a comment. Claude-Session: https://claude.ai/code/session_01QzEdy5fN5JKGxJo8gwtNeu Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c206ef3 commit e51227a

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

falco-benchmarks/src/jmh/java/net/onelitefeather/falco/benchmark/light/AreaVsPerChunkBenchmark.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@
4040
* of this class: it is a decision, not a report.
4141
* </p>
4242
* <p>
43-
* Both sides run on the same chunks and write into them, which is what the real code does. The
44-
* chunks are rebuilt per iteration so neither side benefits from the light the other one left
45-
* behind.
43+
* Both sides run on the same chunks and write into them, which is what the real code does. Neither
44+
* side benefits from the light the other one left behind, because JMH gives each measured method its
45+
* own trial and {@code @Setup(Level.Trial)} builds the chunks afresh for it.
46+
* </p>
47+
* <p>
48+
* Within one trial the chunks are <em>not</em> rebuilt between iterations, and both methods write
49+
* light into them, so every iteration after the first measures a re-light of already lit chunks
50+
* rather than a first light. Whether that moves the number is untested: raising the setup to
51+
* {@link Level#Iteration} would answer it, at the cost of leaving the configuration the published
52+
* table was measured under.
4653
* </p>
4754
*
4855
* @author TheMeinerLP

falco-light/src/main/java/net/onelitefeather/falco/light/FalcoLightingChunk.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@
3333
* {@code InstanceContainer} the server ships with.
3434
* </p>
3535
* <p>
36-
* <b>This class holds no computation logic on purpose.</b> Three overrides, and every one of them
37-
* only reports something to the scheduler. Everything else — the dirty set, the areas, the executor,
38-
* the back pressure — lives in {@link ChunkLightScheduler}, so a reader looking for the behaviour
39-
* finds it in one place rather than spread across a chunk and a scheduler.
36+
* <b>This class holds no computation logic on purpose.</b> Five overrides, and none of them computes
37+
* light. Three report to the scheduler — {@code setBlock} and {@code onLoad} mark the chunk dirty,
38+
* {@code tick} passes the tick on. The other two serve the light packet this chunk sends its
39+
* viewers: {@code invalidate} drops the cached packet, and {@code onLightUpdated} drops it and sends
40+
* a fresh one. Everything else — the dirty set, the areas, the executor, the back pressure — lives
41+
* in {@link ChunkLightScheduler}, so a reader looking for the behaviour finds it in one place rather
42+
* than spread across a chunk and a scheduler.
4043
* </p>
4144
* <p>
4245
* <b>What it reports is a position, not just a chunk.</b> {@code setBlock} knows exactly which block

0 commit comments

Comments
 (0)