[PR #7325] [MERGED] port map: rest-001's Givens, Jacobi and SVD rows are ported in math.rs #7492

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

📋 Pull Request Information

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

Base: main ← Head: chore/vol-c-rest-001


📝 Commits (3)

  • 806e846 port_map: rest-001's Givens and Jacobi rows are the SVD in math.rs
  • 8687fd6 port_map: rest-001's notes name the radians, the one caller and the rows
  • 0976c2b Merge main into #7325

📊 Changes

1 file changed (+17 additions, -15 deletions)

View changed files

📝 tools/port_map/rest-001.tsv (+17 -15)

📄 Description

Rows of tools/port_map/rest-001.tsv (152 rows, map-check clean against 26.3): com.mojang.math — MatrixUtil, GivensParameters, OctahedralGroup — then the crash-report and advancement rows.

Verdicts

Fourteen rows of MatrixUtil and GivensParameters were filed skip:other, "Givens/Jacobi helper for the SVD split", on the grounds that Horizon needs no SVD. crates/horizon-assets/src/math.rs is that split, whole: svd_decompose documents itself as new Transformation(matrix) and the helpers beneath it are the vanilla ones.

row was now where
GivensParameters.fromUnnormalized skip:other port crates/horizon-assets/src/math.rs::Givens::unnormalized
GivensParameters.fromPositiveAngle skip:other inline crates/horizon-assets/src/math.rs::Givens::quarter_pi
GivensParameters.aroundX skip:other inline crates/horizon-assets/src/math.rs::Givens::quaternion
GivensParameters.aroundY skip:other inline crates/horizon-assets/src/math.rs::Givens::quaternion
GivensParameters.aroundZ skip:other inline crates/horizon-assets/src/math.rs::Givens::quaternion
GivensParameters.cos skip:other port crates/horizon-assets/src/math.rs::Givens::cos
MatrixUtil.approxGivensQuat skip:other port crates/horizon-assets/src/math.rs::approx_givens
MatrixUtil.qrGivensQuat skip:other port crates/horizon-assets/src/math.rs::qr_givens
MatrixUtil.similarityTransform skip:other inline crates/horizon-assets/src/math.rs::step_jacobi
MatrixUtil.stepJacobi skip:other port crates/horizon-assets/src/math.rs::step_jacobi
MatrixUtil.eigenvalueJacobi skip:other inline crates/horizon-assets/src/math.rs::svd_decompose
MatrixUtil.svdDecompose skip:other port crates/horizon-assets/src/math.rs::svd_decompose

Two rows that had none, both ported by a Givens method that had no row of its own:

row now where
GivensParameters.sin port crates/horizon-assets/src/math.rs::Givens::sin
GivensParameters.inverse port crates/horizon-assets/src/math.rs::Givens::inverse

Four of the twelve are inline rather than ported, and their notes say which part of the bigger function they are: fromPositiveAngle is only built for its π/4 case (MatrixUtil.PI_4), aroundX/Y/Z are the three axes of one quaternion(axis) builder (matrix(axis) is the Matrix3f form of the same three), similarityTransform is the R^T * m * R inside step_jacobi's rotate closure, and eigenvalueJacobi is the five step_jacobi passes over a^T * a in svd_decompose, after which the quaternion is normalised.

Notes repaired

  • Axis.rotateDegrees said only that call sites convert degrees to radians; it now names what they convert for, math.rs::quaternion_from_axis_angle, which takes the angle in radians.
  • MatrixUtil.mulComponentWise keeps its missing, but now names the one method that reaches it — ItemFeatureRenderer.computeFoilDecalPose, the 0.5 GUI and 0.75 first-person foil decal matrix — and what the tree has instead: the SVD half of MatrixUtil in math.rs, a per-context glint scale in item_render.rs, and no component-wise matrix product anywhere.
  • SystemReport.<init> gains the function its rows are built in, crash.rs::system_details, and with it what the report carries before the gap: Horizon and Minecraft version, operating system, CPU, memory, then what the game set as it ran (graphics adapter, settings, packs, world). The gap stands: no storage, process or JVM lines.

Checked and left alone: Transformation.inverse's missing null for a non-finite inverse (Affine::inverse divides by the determinant unchecked), Transformation.slerp's player gap (text_display.rs is the only slerp in the tree), AdvancementTree.remove (the removed ids are dropped from the list, no child walk), and every SystemReport memory/storage row, which the report's five system details bear out.

Map-check:

PORT_LEDGER_OUT=... python3 tools/port_ledger.py map-check tools/port_map/rest-001.tsv
152 rows, no problems.

Proven: each of the twelve reads at the cite — unnormalized's 1/sqrt(s² + c²), quarter_pi's fromPositiveAngle(π/4) doc, quaternion(axis)'s four components, cos's c² - s² and sin's 2sc, approx_givens's 3 + 2√2 threshold against PI_4, qr_givens's 1e-6 case and sign swap, step_jacobi's three pairs at 1e-6 with R^T m R between them, and svd_decompose's five-pass loop, scale from the diagonal and negated right rotation. MatrixUtil.mulComponentWise's single caller is the ledger's; the absence of a component-wise product is a grep of crates/.

Not proven: that svd_decompose is reached on the paths that need it — its one caller is new Transformation(matrix), and I did not trace which callers build a Transformation from a raw matrix. The two added rows rest on two-line methods read at the cite, not on a parity test.


🔄 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/7325 **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/vol-c-rest-001` --- ### 📝 Commits (3) - [`806e846`](https://github.com/horizon-rust/horizon/commit/806e8466250c93cfe6788b52bdc265108fc68de8) port_map: rest-001's Givens and Jacobi rows are the SVD in math.rs - [`8687fd6`](https://github.com/horizon-rust/horizon/commit/8687fd655daa05adac20d05c35620e5775e4bb6c) port_map: rest-001's notes name the radians, the one caller and the rows - [`0976c2b`](https://github.com/horizon-rust/horizon/commit/0976c2b8a615e94c6e5469d887a3582d80cc1a33) Merge main into #7325 ### 📊 Changes **1 file changed** (+17 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-001.tsv` (+17 -15) </details> ### 📄 Description Rows of `tools/port_map/rest-001.tsv` (152 rows, map-check clean against 26.3): `com.mojang.math` — `MatrixUtil`, `GivensParameters`, `OctahedralGroup` — then the crash-report and advancement rows. **Verdicts** Fourteen rows of `MatrixUtil` and `GivensParameters` were filed `skip:other`, "Givens/Jacobi helper for the SVD split", on the grounds that Horizon needs no SVD. `crates/horizon-assets/src/math.rs` is that split, whole: `svd_decompose` documents itself as `new Transformation(matrix)` and the helpers beneath it are the vanilla ones. | row | was | now | where | | --- | --- | --- | --- | | `GivensParameters.fromUnnormalized` | skip:other | port | `crates/horizon-assets/src/math.rs::Givens::unnormalized` | | `GivensParameters.fromPositiveAngle` | skip:other | inline | `crates/horizon-assets/src/math.rs::Givens::quarter_pi` | | `GivensParameters.aroundX` | skip:other | inline | `crates/horizon-assets/src/math.rs::Givens::quaternion` | | `GivensParameters.aroundY` | skip:other | inline | `crates/horizon-assets/src/math.rs::Givens::quaternion` | | `GivensParameters.aroundZ` | skip:other | inline | `crates/horizon-assets/src/math.rs::Givens::quaternion` | | `GivensParameters.cos` | skip:other | port | `crates/horizon-assets/src/math.rs::Givens::cos` | | `MatrixUtil.approxGivensQuat` | skip:other | port | `crates/horizon-assets/src/math.rs::approx_givens` | | `MatrixUtil.qrGivensQuat` | skip:other | port | `crates/horizon-assets/src/math.rs::qr_givens` | | `MatrixUtil.similarityTransform` | skip:other | inline | `crates/horizon-assets/src/math.rs::step_jacobi` | | `MatrixUtil.stepJacobi` | skip:other | port | `crates/horizon-assets/src/math.rs::step_jacobi` | | `MatrixUtil.eigenvalueJacobi` | skip:other | inline | `crates/horizon-assets/src/math.rs::svd_decompose` | | `MatrixUtil.svdDecompose` | skip:other | port | `crates/horizon-assets/src/math.rs::svd_decompose` | Two rows that had none, both ported by a `Givens` method that had no row of its own: | row | now | where | | --- | --- | --- | | `GivensParameters.sin` | port | `crates/horizon-assets/src/math.rs::Givens::sin` | | `GivensParameters.inverse` | port | `crates/horizon-assets/src/math.rs::Givens::inverse` | Four of the twelve are inline rather than ported, and their notes say which part of the bigger function they are: `fromPositiveAngle` is only built for its π/4 case (`MatrixUtil.PI_4`), `aroundX/Y/Z` are the three axes of one `quaternion(axis)` builder (`matrix(axis)` is the `Matrix3f` form of the same three), `similarityTransform` is the `R^T * m * R` inside `step_jacobi`'s rotate closure, and `eigenvalueJacobi` is the five `step_jacobi` passes over `a^T * a` in `svd_decompose`, after which the quaternion is normalised. **Notes repaired** - `Axis.rotateDegrees` said only that call sites convert degrees to radians; it now names what they convert for, `math.rs::quaternion_from_axis_angle`, which takes the angle in radians. - `MatrixUtil.mulComponentWise` keeps its `missing`, but now names the one method that reaches it — `ItemFeatureRenderer.computeFoilDecalPose`, the 0.5 GUI and 0.75 first-person foil decal matrix — and what the tree has instead: the SVD half of `MatrixUtil` in `math.rs`, a per-context glint scale in `item_render.rs`, and no component-wise matrix product anywhere. - `SystemReport.<init>` gains the function its rows are built in, `crash.rs::system_details`, and with it what the report carries before the gap: Horizon and Minecraft version, operating system, CPU, memory, then what the game set as it ran (graphics adapter, settings, packs, world). The gap stands: no storage, process or JVM lines. Checked and left alone: `Transformation.inverse`'s missing null for a non-finite inverse (`Affine::inverse` divides by the determinant unchecked), `Transformation.slerp`'s player gap (`text_display.rs` is the only `slerp` in the tree), `AdvancementTree.remove` (the removed ids are dropped from the list, no child walk), and every `SystemReport` memory/storage row, which the report's five system details bear out. Map-check: ``` PORT_LEDGER_OUT=... python3 tools/port_ledger.py map-check tools/port_map/rest-001.tsv 152 rows, no problems. ``` **Proven:** each of the twelve reads at the cite — `unnormalized`'s `1/sqrt(s² + c²)`, `quarter_pi`'s `fromPositiveAngle(π/4)` doc, `quaternion(axis)`'s four components, `cos`'s `c² - s²` and `sin`'s `2sc`, `approx_givens`'s `3 + 2√2` threshold against `PI_4`, `qr_givens`'s `1e-6` case and sign swap, `step_jacobi`'s three pairs at `1e-6` with `R^T m R` between them, and `svd_decompose`'s five-pass loop, scale from the diagonal and negated right rotation. `MatrixUtil.mulComponentWise`'s single caller is the ledger's; the absence of a component-wise product is a grep of `crates/`. **Not proven:** that `svd_decompose` is reached on the paths that need it — its one caller is `new Transformation(matrix)`, and I did not trace which callers build a `Transformation` from a raw matrix. The two added rows rest on two-line methods read at the cite, not on a parity test. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:40:08 +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#7492
No description provided.