[PR #7001] [MERGED] Clear stale rest-022.tsv HashOps, Mth and PNG header rows #7261

Closed
opened 2026-11-03 06:36:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7001
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: chore/ledger-rest-022


📝 Commits (1)

  • a8a0b95 Clear stale rest-022 HashOps, Mth and PNG header rows

📊 Changes

1 file changed (+12 additions, -12 deletions)

View changed files

📝 tools/port_map/rest-022.tsv (+12 -12)

📄 Description

tools/port_map/rest-022.tsv: twelve rows whose missing/unsure verdict no longer matches the tree.

  • HashOps.createNumeric -> inline crates/horizon-protocol/src/hash_ops.rs::HashOps::from_nbt (a numeric component hashes through create_byte/create_short/create_int/create_long/create_float/create_double; from_nbt picks one by tag type)
  • HashOps.createString -> port crates/horizon-protocol/src/hash_ops.rs::HashOps::create_string (length in UTF-16 units, then each unit, tag 12)
  • HashOps.hashMap -> inline crates/horizon-protocol/src/hash_ops.rs::HashOps::from_nbt (the compound arm hashes each key with create_string and each value, then create_map sorts the pairs)
  • HashOps.createMap -> port crates/horizon-protocol/src/hash_ops.rs::HashOps::create_map (entries sorted by key then value hash, tags 2 and 3)
  • HashOps.createList -> port crates/horizon-protocol/src/hash_ops.rs::HashOps::create_list (values in order, tags 4 and 5)
  • HashOps.createByteList -> port crates/horizon-protocol/src/hash_ops.rs::HashOps::create_byte_list (tag 14, the bytes, tag 15)
  • HashOps.createIntList -> port crates/horizon-protocol/src/hash_ops.rs::HashOps::create_int_list (tag 16, little-endian ints, tag 17)
  • HashOps.createLongList -> port crates/horizon-protocol/src/hash_ops.rs::HashOps::create_long_list (tag 18, little-endian longs, tag 19)
  • Mth.clampedMap -> inline crates/horizon-client/src/title/onboarding.rs::Onboarding::widget_alpha (inverse lerp clamped to 0..1, then scaled into the new range)
  • Mth.map -> inline crates/horizon-client/src/mobs/sulfur_cube.rs::vertical_hit_angle_power_transfer ((value - from) / (to - from), scaled into the new range at the call site)
  • PngInfo.fromStream -> inline crates/horizon-client-render/src/hud.rs::png_size (signature and IHDR type checked, width/height read from the header; bit depth and colour type are not read)
  • PngInfo.validateHeader -> inline crates/horizon-client-render/src/hud.rs::png_size (eight signature bytes and the IHDR chunk type; the IHDR length field is not checked)

map-check (last build of the same 26.3 jar) on the edited file prints only the pre-existing SimpleBitStorage.cellIndex problem at line 141 (crates/horizon-core/src/paletted.rs::locate is not a fn); the identical line prints for a clean origin/main copy of the file, and that row is untouched here.

Proven: javap on 26.3 gives the tag bytes and payloads the notes name: createString 12 + putInt(length) + putUnencodedChars, createByteList 14/15, createIntList 16/17, createLongList 18/19, createMap through the private hashMap helper (2/3), and createNumeric dispatching a Number by class to createByte/Short/Int/Long/Double/Float. hash_ops.rs has every one of those functions with tests that match the hashes vanilla prints, and the item component hashes use them. The two Mth formulas and the PNG header read (\x89PNG\r\n\x1a\n then an IHDR type and the two big-endian dimensions) are in the cited functions.

Not proven: PngInfo.validateBounds (no 16-bit widthheight8 int-overflow check), GsonHelper.encodesLongerThan (no 32767-character encoded-component check), InclusiveRange.contains (no subrange containment; light ranges are single values) and KeyframeTrack.validateKeyframes/validatePeriod (no ordering, duplicate-tick or period check on load); their verdicts stay missing.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7001 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/ledger-rest-022` --- ### 📝 Commits (1) - [`a8a0b95`](https://github.com/horizon-rust/horizon/commit/a8a0b95dbd2fe7630139928d02944aece0eb4699) Clear stale rest-022 HashOps, Mth and PNG header rows ### 📊 Changes **1 file changed** (+12 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-022.tsv` (+12 -12) </details> ### 📄 Description `tools/port_map/rest-022.tsv`: twelve rows whose `missing`/`unsure` verdict no longer matches the tree. - `HashOps.createNumeric` -> inline `crates/horizon-protocol/src/hash_ops.rs::HashOps::from_nbt` (a numeric component hashes through create_byte/create_short/create_int/create_long/create_float/create_double; from_nbt picks one by tag type) - `HashOps.createString` -> port `crates/horizon-protocol/src/hash_ops.rs::HashOps::create_string` (length in UTF-16 units, then each unit, tag 12) - `HashOps.hashMap` -> inline `crates/horizon-protocol/src/hash_ops.rs::HashOps::from_nbt` (the compound arm hashes each key with create_string and each value, then create_map sorts the pairs) - `HashOps.createMap` -> port `crates/horizon-protocol/src/hash_ops.rs::HashOps::create_map` (entries sorted by key then value hash, tags 2 and 3) - `HashOps.createList` -> port `crates/horizon-protocol/src/hash_ops.rs::HashOps::create_list` (values in order, tags 4 and 5) - `HashOps.createByteList` -> port `crates/horizon-protocol/src/hash_ops.rs::HashOps::create_byte_list` (tag 14, the bytes, tag 15) - `HashOps.createIntList` -> port `crates/horizon-protocol/src/hash_ops.rs::HashOps::create_int_list` (tag 16, little-endian ints, tag 17) - `HashOps.createLongList` -> port `crates/horizon-protocol/src/hash_ops.rs::HashOps::create_long_list` (tag 18, little-endian longs, tag 19) - `Mth.clampedMap` -> inline `crates/horizon-client/src/title/onboarding.rs::Onboarding::widget_alpha` (inverse lerp clamped to 0..1, then scaled into the new range) - `Mth.map` -> inline `crates/horizon-client/src/mobs/sulfur_cube.rs::vertical_hit_angle_power_transfer` ((value - from) / (to - from), scaled into the new range at the call site) - `PngInfo.fromStream` -> inline `crates/horizon-client-render/src/hud.rs::png_size` (signature and IHDR type checked, width/height read from the header; bit depth and colour type are not read) - `PngInfo.validateHeader` -> inline `crates/horizon-client-render/src/hud.rs::png_size` (eight signature bytes and the IHDR chunk type; the IHDR length field is not checked) map-check (last build of the same 26.3 jar) on the edited file prints only the pre-existing `SimpleBitStorage.cellIndex` problem at line 141 (`crates/horizon-core/src/paletted.rs::locate` is not a fn); the identical line prints for a clean `origin/main` copy of the file, and that row is untouched here. **Proven:** javap on 26.3 gives the tag bytes and payloads the notes name: createString 12 + putInt(length) + putUnencodedChars, createByteList 14/15, createIntList 16/17, createLongList 18/19, createMap through the private hashMap helper (2/3), and createNumeric dispatching a Number by class to createByte/Short/Int/Long/Double/Float. `hash_ops.rs` has every one of those functions with tests that match the hashes vanilla prints, and the item component hashes use them. The two Mth formulas and the PNG header read (`\x89PNG\r\n\x1a\n` then an `IHDR` type and the two big-endian dimensions) are in the cited functions. **Not proven:** `PngInfo.validateBounds` (no 16-bit width*height*8 int-overflow check), `GsonHelper.encodesLongerThan` (no 32767-character encoded-component check), `InclusiveRange.contains` (no subrange containment; light ranges are single values) and `KeyframeTrack.validateKeyframes`/`validatePeriod` (no ordering, duplicate-tick or period check on load); their verdicts stay `missing`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:36:37 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7261
No description provided.