mojira.dev
MC-312746

Gradient endpoint rounding allows MAX to return below its constant operand.

Summary
A finite Gradient can evaluate outside its declared range. A parent MAX trusts that range, discards a required positive constant, and returns a value smaller than that constant. This does not require NaN, Infinity, distant coordinates, or a cache wrapper.

Minimal graph:
{
  "type": "minecraft:max",
  "left": {
    "type": "minecraft:gradient",
    "axis": "y",
    "from_coordinate": 0,
    "to_coordinate": 1,
    "from_value": 1,
    "to_value": 1.4901161193847656e-08
  },
  "right": 7.450580596923828e-09
}

Steps to Reproduce (plain Vanilla server)

  1. Extract F4-GF-attachments.zip. Follow reproductions/common/RUNBOOK.md using official 26.3 dependencies and Java 25.

  2. Create separate fresh server directories for reproductions/F4-GF/packs/candidate and reproductions/F4-GF/packs/control. Use the supplied server.properties.template: seed 123456789, preset probe:runtime, and the selected pack installed as world/datapacks/probe-runtime.

  3. In each server console, force-load the origin chunk and wait for the loaded-check marker, as described in the runbook. Run its two read-only block checks at (0,1,0).

  4. The candidate reports air; the control reports stone. Save and stop each server. The runbook also explains how to check the saved result after restarting the same world, without an observer or external NBT reader.

The candidate's final_density is the minimal graph above. The control applies clamp(G,2^-27,1) to the same Gradient G. At Y=1, both this clamp and ordinary MAX should map the observed G=+0 to the positive value 2^-27.

Expected Result
At (0,1,0), the selected float Gradient kernel returns +0. Applying ordinary MAX to that result and the positive constant 2^-27 should return 2^-27, binary32 bits 32000000.

This expectation preserves the same float child computation. It does not require exact real-number interpolation or double-precision evaluation. In the supplied isolated world-generation setup, the corresponding expected saved block is stone, as seen in the control world.

Actual Result
The compiled MAX returns +0, binary32 bits 00000000, which is less than its constant operand. The retained plain Vanilla candidate world saves air at (0,1,0); the control world saves stone.

Separate passive-observer runs captured native density 00000000 for the candidate and 32000000 for the control at that coordinate. Their saved blocks agree with the corresponding plain-server worlds. Plain-server runs themselves do not expose internal density bits.

Technical Explanation
Gradient reconstructs the endpoint using rounded float arithmetic. Here, to_value - from_value rounds to -1. With a coordinate span of 1, reconstructing the value at Y=1 produces +0. However, Gradient declares the endpoint hull [2^-26,1]. MAX therefore treats the constant 2^-27 as unable to win and removes it.

Relevant implementation locations are GradientFunction's sampler/range and BinaryFunction's MAX compilation. technical/source-reference-index.json identifies the retained local decompiled snapshot by class, scope, line range, and SHA-256; no decompiled Minecraft implementation source is attached.

Optional Numerical Reproduction
Follow reproductions/F4-GF/sampler/RUNBOOK.md with the supplied original research-authored probe and one-case manifest. Inspect gradient-small-max, optimized / cold-volume, repeat 0, at (0,1,0). That Volume has dimensions (2,4,2), minimum (0,-2,0), and unit steps; its index is 3. The test-side source-float baseline returns 32000000, while the compiled sampler returns 00000000.

The original cited run is independent-20261018T053319082587Z, operation 699, reference byte offset 24, actual byte offset 28. A subset rerun changes operation numbering. This is a Volume witness; no Point result at Y=1 is claimed. The worldgen Volume has separate geometry and index 65 for the same coordinate.

Attachments and Scope
F4-GF-attachments.zip contains the candidate/control datapacks, minimal JSON, original authored sampler probe, case selection, reproduction instructions, hashes, and a derived excerpt of the audited original results. It includes no official Minecraft JAR, JDK, or decompiled Minecraft implementation source.

The existing evidence covers independent sampling, formal datapack acceptance, normal chunk generation with these custom packs, and saved blocks. No frequency claim is made for default Overworld terrain or for other versions, CPUs, or JDKs. This final documentation review did not rerun Java or Minecraft. The newly documented console block checks and restart workflow are future reproduction instructions, checked statically against the retained setup.

Environment

Minecraft: Java Edition 26.3 Java 25 Official Vanilla dedicated server, without mods. Reproduced in separate fresh worlds using the attached candidate and control datapacks.

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media]

ryo_256

(Unassigned)

Plausible

26.3

Retrieved