BaldDemian opened a new pull request, #3523:
URL: https://github.com/apache/fory/pull/3523

   <!--
   **Thanks for contributing to Apache Fory™.**
   
   **If this is your first time opening a PR on fory, you can refer to 
[CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).**
   
   Contribution Checklist
   
       - The **Apache Fory™** community has requirements on the naming of pr 
titles. You can also find instructions in 
[CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).
   
       - Apache Fory™ has a strong focus on performance. If the PR you submit 
will have an impact on performance, please benchmark it first and provide the 
benchmark result here.
   -->
   
   ## Why?
   
   Current Fory compiler's translator and validator for protobuf cannot handle 
the package information correctly. All four newly-added test cases in 
`test_proto_frontend.py` would fail in the current version, despite they are 
all verified by protoc (should reject / should accept).
   
   ## What does this PR do?
   
   - Introduce a new `package` field to the `Message`, `Enum`, and `Union` 
types in the Fory IR AST. For `.fbs` and `.fdl` inputs, this field is always 
`None`. During protobuf translation, type looking-up and validation, the 
package information is utilized and enforced.
   
   - Define testcases accordingly. Actually this fix is test-driven.
   
   ## Related issues
   
   N/A.
   
   <!--
   Is there any related issue? If this PR closes them you say say fix/closes:
   
   - #xxxx0
   - #xxxx1
   - Fixes #xxxx2
   -->
   
   ## AI Contribution Checklist
   
   - [X] Substantial AI assistance was used in this PR: `yes` / `no`
   - [X] If `yes`, I included the standardized `AI Usage Disclosure` block 
below.
   - [X] If `yes`, I can explain and defend all important changes without AI 
help.
   - [X] If `yes`, I reviewed AI-assisted code changes line by line before 
submission.
   - [X] If `yes`, I ran adequate human verification and recorded evidence 
(checks run locally or in CI, pass/fail summary, and confirmation I reviewed 
results).
   - [X] If `yes`, I added/updated tests and specs where required.
   - [X] If `yes`, I validated protocol/performance impacts with evidence when 
applicable.
   - [X] If `yes`, I verified licensing and provenance compliance.
   
   AI Usage Disclosure
   - substantial_ai_assistance: yes
   - scope: bug-fix suggestions, compiler code structure clarification
   - affected_files_or_subsystems: 
compiler/fory_compiler/frontend/proto/translator.py, 
compiler/fory_compiler/ir/ast.py, compiler/fory_compiler/ir/validator.py
   - human_verification: I have run the tests locally and review the changes
   - performance_verification: N/A
   - provenance_license_confirmation: Apache-2.0-compatible provenance 
confirmed; no incompatible third-party code introduced
   
   ## Does this PR introduce any user-facing change?
   
   N/A.
   
   ## Benchmark
   
   N/A.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to