OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-tps commits / c3a5754

_probe_fold_split: digest hashes face windings, brushes ordered by bytes (hyper-games #127)
The digest now covers what face_winding produces (DCLevel.get_face_winding per face), so a libdc change that must not alter geometry is checked on its output; brushes are ordered by those bytes, never by key (time-derived seq). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c3a5754166fdd1a3a3aedc1fcad87c31d6a93acb
by plankatron <fleeky@gmail.com> · 2026-10-19T18:38:42.000Z

Changed files (1) +15 -9

scenes/test/_probe_fold_split.gd +15 -9
……@@ -142,17 +142,23 @@ func _split(case: String) -> void:
142142 tot.append(float(Time.get_ticks_usec() - t1) / 1000.0)
143143 var ids: PackedInt32Array = level.get_live_brush_ids()
144144 var planes := 0
145 var h := HashingContext.new()
146 h.start(HashingContext.HASH_SHA256)
147 var keyed: Array = []
145 # THE DIGEST HASHES WHAT face_winding PRODUCES: every live brush's face windings (as
146 # DCLevel.get_face_winding returns them), the brushes ordered by those bytes — never by
147 # key, whose seq is time-derived and differs run to run.
148 var blobs: Array = []
148149 for b: int in ids:
149 keyed.append([String(level.get_brush_key(b)), b])
150 keyed.sort_custom(func(x: Array, y: Array) -> bool: return String(x[0]) < String(y[0]))
151 for kb: Array in keyed:
152 var pl: PackedFloat32Array = level.get_brush(int(kb[1]))["planes"]
150 var pl: PackedFloat32Array = level.get_brush(b)["planes"]
153151 planes += pl.size() / 4
154 h.update(String(kb[0]).to_utf8_buffer())
155 h.update(pl.to_byte_array())
152 var bb := PackedByteArray()
153 for f in pl.size() / 4:
154 bb.append_array((level.get_face_winding(b, f) as PackedVector3Array).to_byte_array())
155 bb.append(255)
156 blobs.append(bb)
157 blobs.sort_custom(func(x: PackedByteArray, y: PackedByteArray) -> bool: return x.hex_encode() < y.hex_encode())
158 var h := HashingContext.new()
159 h.start(HashingContext.HASH_SHA256)
160 for bb2: PackedByteArray in blobs:
161 h.update(bb2)
156162 print("PROBE %s: %d live brushes, %d planes, %d brush records, ops/mods %d" % [case, ids.size(), planes, brush_recs.size(), extra])
157163 print("PROBE %s: partition %.1f | ShapeFold.expand %.1f | apply_journal %.1f | rebuild %.1f | (sum %.1f) | refold() %.1f ms"
158164 % [case, _med(part), _med(ex), _med(ap), _med(rb), _med(part) + _med(ex) + _med(ap) + _med(rb), _med(tot)])