Commit 1e43394
authored
fix(xlang): close field tag validation gaps (#3984)
## Why?
PR #3982 established the signed-int32 field-tag protocol range.
Follow-up integration checks found a
small set of validation ownership, exact-schema coverage, and
documentation gaps that were not part
of the squash-merged boundary.
This PR completes those paths without changing the field-tag wire format
introduced by #3982.
## What does this PR do?
- Rejects duplicate Java native TypeDef tags across the complete
inheritance hierarchy.
- Validates Go field tags before public registration mutates resolver
state while continuing to
ignore unexported fields.
- Keeps Rust protocol metadata equality independent from local
compatible-reader dispatch state.
- Adds causal C++ remote-compatible and oversized-tag decoder coverage.
- Adds an exact-schema cross-language fixture for tags `15`, `65551`,
and `536870911` across all
supported peers, including normal concrete Java test discovery.
- Runs Kotlin's maximum tag through a real KSP-generated serializer,
descriptor, and round trip.
- Documents the exact field-tag range, uniqueness, stability, and
extended encoding rules in the
protocol, compiler, and runtime schema guides.
## Related issues
Follow-up to #3982.
## Does this PR introduce any user-facing change?
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
Invalid duplicate or out-of-range field-tag schemas are now rejected
consistently at their owning
registration or metadata boundary. Existing valid schemas and wire bytes
are unchanged.
## Test
- Java native TypeDef, Go registration, C++ metadata, Rust metadata
equality, and Kotlin KSP/static
serializer tests passed.
- Exact-schema and compatible Java-driven field-tag cases passed against
C++, C#, Dart, Go,
JavaScript, Python, Rust, Scala, and Swift in both Java codegen modes.
- Dart IDL regeneration, compilation, and Java/Dart semantic round trips
passed.
- Java Spotless, Rust fmt/clippy, Go formatting, C++ formatting,
Markdown Prettier, and full diff
checks passed.
## Benchmark
The production changes in this follow-up are Java remote native-TypeDef
miss validation, Go
registration-time validation, and Rust `FieldInfo` equality. None is
reached by the steady-state
serialize/deserialize benchmark loops from #3982, so those paired
results remain the causal hot-path
evidence. Every measured runtime/path stayed below the `+1.0%`
regression ceiling; the largest
positive paired medians were C++ deserialize at `+0.858%` and Java
static serialize at `+0.779%`.1 parent 3bfa17e commit 1e43394
47 files changed
Lines changed: 560 additions & 50 deletions
File tree
- .github/workflows
- cpp/fory/serialization
- csharp/tests/Fory.XlangPeer
- dart/packages/fory-test
- lib/entity
- test/cross_lang_test
- docs
- compiler
- object-serialization
- cpp
- csharp
- dart
- go
- javascript
- java
- kotlin
- python
- rust
- scala
- swift
- specification
- go/fory
- tests/xlang
- javascript/test
- java/fory-core/src
- main/java/org/apache/fory/meta
- test/java/org/apache/fory
- meta
- xlang
- kotlin
- fory-kotlin-ksp/src/test/kotlin/org/apache/fory/kotlin/ksp
- fory-kotlin-tests/src/main/kotlin/org/apache/fory/kotlin/xlang
- python/pyfory
- tests
- rust
- fory-core/src/meta
- tests/tests
- scala/fory-scala/src/test/scala-3/org/apache/fory/serializer/scala
- swift/Tests/ForyXlangTests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
149 | 163 | | |
150 | 164 | | |
151 | 165 | | |
| |||
1403 | 1417 | | |
1404 | 1418 | | |
1405 | 1419 | | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1406 | 1426 | | |
1407 | 1427 | | |
1408 | 1428 | | |
| |||
1412 | 1432 | | |
1413 | 1433 | | |
1414 | 1434 | | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1415 | 1450 | | |
1416 | 1451 | | |
1417 | 1452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
| |||
938 | 949 | | |
939 | 950 | | |
940 | 951 | | |
| 952 | + | |
941 | 953 | | |
942 | 954 | | |
943 | 955 | | |
| |||
1030 | 1042 | | |
1031 | 1043 | | |
1032 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
1033 | 1047 | | |
1034 | 1048 | | |
1035 | 1049 | | |
| |||
1570 | 1584 | | |
1571 | 1585 | | |
1572 | 1586 | | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
1573 | 1602 | | |
1574 | 1603 | | |
1575 | 1604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| |||
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
464 | 472 | | |
465 | 473 | | |
466 | 474 | | |
| |||
1282 | 1290 | | |
1283 | 1291 | | |
1284 | 1292 | | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
1285 | 1304 | | |
1286 | 1305 | | |
1287 | 1306 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
494 | 499 | | |
495 | 500 | | |
496 | 501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
979 | 984 | | |
980 | 985 | | |
981 | 986 | | |
| |||
1149 | 1154 | | |
1150 | 1155 | | |
1151 | 1156 | | |
1152 | | - | |
| 1157 | + | |
1153 | 1158 | | |
1154 | 1159 | | |
1155 | 1160 | | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
1159 | 1164 | | |
1160 | 1165 | | |
1161 | 1166 | | |
1162 | 1167 | | |
1163 | 1168 | | |
1164 | 1169 | | |
1165 | | - | |
| 1170 | + | |
1166 | 1171 | | |
1167 | | - | |
| 1172 | + | |
1168 | 1173 | | |
1169 | 1174 | | |
1170 | 1175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
0 commit comments