Sync scalar_type.fbs and extend test to check all copies#17085
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17085
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New FailuresAs of commit e22e231 with merge base b698260 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: none" |
There was a problem hiding this comment.
Pull request overview
This PR keeps all copies of scalar_type.fbs in sync across the repository and adds a regression test to ensure they stay synchronized, addressing issue #11572.
Changes:
- Updated
extension/flat_tensor/serialize/scalar_type.fbsto match the canonicalschema/scalar_type.fbs, including FLOAT8E* and UINT* scalar types and aligned header comments. - Replaced the previous one-off equality check in
test_schema.pywith a subtest-based loop that verifies all known copies ofscalar_type.fbsmatch the canonical schema and emits clearer, tooling-agnostic error messages.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| extension/flat_tensor/serialize/scalar_type.fbs | Synchronizes this schema copy with the canonical schema/scalar_type.fbs, including new FLOAT8 and UINT scalar types and matching header comments. |
| devtools/bundled_program/schema/test/test_schema.py | Expands test_schema_sync to validate all four scalar_type.fbs copies against the canonical schema using subTest() and updates the failure message to a generic, OSS-friendly sync instruction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @mohammed-saalim, changes look good. Thank you so much for adding this. Given the source of truth is in executorch/schema, could we move this test to https://github.com/pytorch/executorch/tree/main/schema/test? |
Move test to schema/test per maintainer request
8228805 to
47b8b57
Compare
|
made changes as suggested. @lucylq |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
devtools/bundled_program/schema/test/test_schema.py:1
- Removing this test file will leave the internal BUCK target at
devtools/bundled_program/schema/test/BUCKwith apython_unittestthat still liststest_schema.pyinsrcs, which will cause that target to fail to build or run; please either update the BUCK rule to point at the new shared test underschema/test/test_schema.pyor keep a thin wrapper test in this directory so the declared target remains valid.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks @mohammed-saalim. I had a check and I think this isn't covered by CI because there weren't python tests in this directory before. Can you add the schema/ directory to pytest.ini, and keep an eye on the unittest ci jobs (e.g. unittest / linux / linux-job, and the macos/windows equivalents), to make sure it's running and passing? For example, see the test: https://github.com/pytorch/executorch/actions/runs/21601350041/job/62247864130#step:16:15427 I guess we want to check that schema/test_schema.py appears in the logs. |
Move test to schema/test per maintainer request
@mohammed-saalim sorry last one - can you also remove the BUCK target here? https://github.com/pytorch/executorch/blob/main/devtools/bundled_program/schema/test/BUCK#L12-L17 |
|
@lucylq my bad! i have removed it. Anything else? |
|
@mohammed-saalim I think that's all good. Thanks for the edits and feel free to merge it once the tests are good 🎉 I don't think this should cause any test failures/github should indicate any flaky tests, but if there are you can check https://hud.pytorch.org/hud/pytorch/executorch/main/1?per_page=50 to see if it's an existing failure (that github didn't catch), or ping me to double check. We may want to add a BUCK target to schema/test but I can do that in a follow-up and test with the internal buck build. |
|
@mohammed-saalim seems like there's a linter issue, do you mind fixing it? You can fix it manually or install the lintrunner following: https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#lintrunner |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@lucylq The 3 failing checks appear to be infrastructure issues unrelated to my changes: 2 Windows build failures |
|
@mohammed-saalim merged. Thank you for your contribution! |
Fixes #11572
This PR:
devtools/bundled_program/schema/test/test_schema.pyto check all 4 copies ofscalar_type.fbsextension/flat_tensor/serialize/scalar_type.fbswhich was out of date (missing FLOAT8E* and UINT* types)The test now validates that these 4 files remain in sync:
schema/scalar_type.fbs(canonical)devtools/bundled_program/schema/scalar_type.fbsdevtools/etdump/scalar_type.fbsextension/flat_tensor/serialize/scalar_type.fbsUses
subTest()for clearer error messages when files drift out of sync.cc @JacobSzwejbka @angelayi