Sign the positive infinity token so flatc 1.12 accepts it - #22770
Conversation
Summary: The non-finite float rewrite added in the parent diff spells positive infinity as a bare `inf`, which fails to lower under the `flatc` shipped in fbsource (1.12.0). `flatc` parses a `VkValue` union member's value before it knows the member's type, so a token that starts with a letter (`inf`, `nan`) is rejected as an unknown value: ``` schema.json:1: 128: error: cannot parse value starting with: inf ``` A signed token takes the numeric path and parses, so this emits `+inf` for positive infinity (`-inf` was already correct). `flatc` writes the bare `inf` back on decompile, which the existing reverse rewrite already maps to json's `Infinity`, so only the forward direction needed the fix. This unbreaks `test_serialize_deserialize_non_finite_scalars` and `test_serialize_deserialize_non_finite_floats_in_list`. Reviewed By: rascani Differential Revision: D119675660
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22770
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (4 Unrelated Failures)As of commit 90e0267 with merge base 1abaa87 ( BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@rascani has exported this pull request. If you are a Meta employee, you can view the originating Diff in D119675660. |
This PR needs a
|
Summary:
The non-finite float rewrite added in the parent diff spells positive
infinity as a bare
inf, which fails to lower under theflatcshippedin fbsource (1.12.0).
flatcparses aVkValueunion member's valuebefore it knows the member's type, so a token that starts with a letter
(
inf,nan) is rejected as an unknown value:A signed token takes the numeric path and parses, so this emits
+inffor positive infinity (
-infwas already correct).flatcwrites thebare
infback on decompile, which the existing reverse rewrite alreadymaps to json's
Infinity, so only the forward direction needed the fix.This unbreaks
test_serialize_deserialize_non_finite_scalarsandtest_serialize_deserialize_non_finite_floats_in_list.Reviewed By: rascani
Differential Revision: D119675660