Skip to content

Conversation

@santigimeno
Copy link
Member

@santigimeno santigimeno commented Jun 6, 2025

Summary by CodeRabbit

  • New Features

    • Added advanced memory layout optimization for generated C++ message classes to improve performance and reduce memory usage.
    • Introduced new build and test targets for enhanced code generation and UPB reflection support.
    • Enhanced parallel processing and statistical reporting for repeated field elements in profiling tools.
    • Added nullability annotations to internal pointer parameters for improved static analysis.
    • Added support for resolving language feature set extensions with default awareness in code generation.
    • Introduced option import handling and symbol visibility enforcement in proto compiler.
  • Bug Fixes

    • Improved enforcement of naming style and option dependencies in proto files.
    • Fixed handling of identifier conflicts in generated C++ code.
    • Corrected symbol visibility rules and disallowed invalid option usage in newer proto editions.
  • Documentation

    • Updated and clarified deprecation notices and usage recommendations for legacy proto features.
    • Added and revised CI and build documentation for dependencies.
  • Refactor

    • Refactored internal code structure for field chunking, memory layout, and string handling.
    • Standardized namespace usage and code style across generated and core files.
    • Moved field chunk logic to dedicated headers and improved byte size calculation code.
    • Replaced multiple overloads with templated forwarding methods in string field generators.
    • Improved code generation includes and macro handling for platform compatibility.
  • Style

    • Improved code consistency by updating include guards and method specifiers in multiple language generators.
    • Added noexcept specifier to swap functions and cleaned up method declarations.
  • Tests

    • Expanded test coverage for naming conflicts, visibility rules, option imports, and memory layout logic.
    • Added tests for feature set extension resolution and option import behavior.
  • Chores

    • Updated build configurations and dependency lists for improved compatibility and maintainability.
    • Added new CI presubmit configurations and updated Bazel build files.
    • Removed deprecated or unused build targets and source files.

@santigimeno santigimeno self-assigned this Jun 6, 2025
@windsurf-bot
Copy link

windsurf-bot bot commented Jun 6, 2025

I ran into an unexpected issue while reviewing this PR. Please try again later.

@coderabbitai
Copy link

coderabbitai bot commented Jun 6, 2025

Walkthrough

This update introduces several new features and improvements to the Protocol Buffers C++ codebase. Major highlights include the addition of a new field chunking and layout optimization system for C++ message generation, expanded nullability annotations throughout the Arena and Any APIs, and significant internal refactoring of message layout and parsing logic. The build system is updated with new targets, source files, and test coverage. Numerous namespace qualification and code style improvements are made, and new tests and documentation are added to support the changes.

Changes

File(s) / Path(s) Change Summary
agents/grpc/src/proto/*.pb.{cc,h} Protobuf C++ generated files updated for version 6.31.1: namespace qualifications, weak attributes, internal offset/metadata changes, version macro updates, no logic changes.
deps/protobuf/.bazelci/*, .bcr/*, .bazelrc Added/updated Bazel CI and presubmit config files, platform matrix expanded, build flags updated, documentation added.
deps/protobuf/protobuf.gyp, src/file_lists.cmake Build configuration updated: new/removed sources, new test files, new micro_string and upb_generator files, test proto file split, target lists updated.
src/google/protobuf/BUILD.bazel Added new upb_c_proto_library and upb_proto_reflection_library targets, new micro_string library and tests, updated dependencies, new test targets and filegroups.
src/google/protobuf/any.{cc,h,pb.cc,pb.h,any_lite.cc} Added PROTOBUF_NONNULL/NULLABLE annotations to pointer parameters, namespace qualification, generated code updates, no logic changes.
src/google/protobuf/api.{pb.cc,pb.h} Generated code updated: namespace qualification, weak attributes, offset table changes, version macro update.
src/google/protobuf/arena.{cc,h,align.cc,cleanup.h} Added nullability annotations throughout Arena API and cleanup helpers, removed GCC 4.9 workaround, new includes, no logic changes.
src/google/protobuf/arenastring.cc Added standard/absl includes, no code logic changes.
src/google/protobuf/arenaz_sampler.h Simplified include guard, marked swap friend function noexcept.
src/google/protobuf/bridge/message_set.proto Marked MessageSet as deprecated, removed usage comments, cc_enable_arenas option removed.
src/google/protobuf/compiler/BUILD.bazel protoc_lib target switched from cc_library to bootstrap_cc_library, new bootstrap_deps, strip_include_prefix removed.
src/google/protobuf/compiler/code_generator.{cc,h,_unittest.cc} Added GetResolvedSourceFeatureExtension method, expanded tests for feature resolution, updated edition defaults in tests, new include.
src/google/protobuf/compiler/command_line_interface{,_unittest}.cc Enforced option dependencies and naming style in CLI, added/updated tests for option imports, naming style, edition rules, and visibility.
src/google/protobuf/compiler/cpp/BUILD.bazel Added field_chunk, message_layout_helper sources/headers, removed padding_optimizer, updated test proto sources, new test target for field_chunk.
src/google/protobuf/compiler/cpp/bootstrap_unittest.cc Use std::make_unique instead of reset(new ...).
src/google/protobuf/compiler/cpp/copy_unittest.cc, move_unittest.cc, unittest.cc Added missing include for unittest_import.pb.h.
src/google/protobuf/compiler/cpp/enum.cc Namespace qualification for standard/absl types.
src/google/protobuf/compiler/cpp/extension.{cc,h} Added feature set defaults emission for specific extensions, corrected include guard comment.
src/google/protobuf/compiler/cpp/field.{h,chunk.cc,chunk.h,chunk_test.cc} Introduced FieldChunk struct and utilities for field chunking, mask generation, chunk tests, port macro includes.
src/google/protobuf/compiler/cpp/file.cc Updated includes, changed inline_fns to inline_defs, updated schema/offset logic, map_field_inl.h replaced by map_field.h.
src/google/protobuf/compiler/cpp/helpers.{cc,h} Added HasRegularStringFields and CollectFieldsExcludingWeakAndOneof, updated symbol export macros, improved field collection logic.
src/google/protobuf/compiler/cpp/message.{cc,h} Refactored to use new field_chunk utilities, updated schema/offset logic, added V2 byte size methods, improved hasbits handling, namespace qualification.
src/google/protobuf/compiler/cpp/message_layout_helper.{cc,h} New class for optimizing message field layout, grouping by alignment/family/hotness, merging groups, new APIs for layout optimization.
src/google/protobuf/compiler/cpp/options.h Removed profile_driven_cluster_aux_subtable option.
src/google/protobuf/compiler/cpp/padding_optimizer.{cc,h} Deleted implementation, replaced with final class overriding MessageLayoutHelper, new constructor, removed public OptimizeLayout.
src/google/protobuf/compiler/cpp/parse_function_generator.{cc,h} Switched vector parameters to absl::Span, new BuildFieldOptions method, friend class for testing, updated function signatures.
src/google/protobuf/compiler/cpp/test_bad_identifiers_{editions,proto2}.proto Split test_bad_identifiers.proto into editions and proto2 versions, expanded identifier conflict coverage.
src/google/protobuf/compiler/cpp/tools/analyze_profile_proto{.cc,.h,_main.cc,_test.cc} Added repeated field element stats, parallel processing, new options for output sorting and parallelism, updated tests for new stats.
src/google/protobuf/compiler/cpp/tracker.cc Use IsArenaStringPtr for string field checks.
src/google/protobuf/compiler/cpp/unittest.inc Updated header includes for test_bad_identifiers, reordered includes.
src/google/protobuf/compiler/csharp/*.h Standardized header guard macros, destructor override specifiers, removed redundant virtual keywords, improved formatting.
src/google/protobuf/compiler/csharp/csharp_doc_comment.{cc,h} Updated split delimiter, header guard, added is_private parameter to doc comment functions.
src/google/protobuf/compiler/csharp/csharp_reflection_class.{cc,h} Added vector::reserve before populating extension name vectors, updated destructor override.
src/google/protobuf/compiler/csharp/names.cc Replaced size checks with .empty() calls.
src/google/protobuf/compiler/java/BUILD.bazel Added absl/status dependency, unified copts, expanded test dependencies.
src/google/protobuf/compiler/java/doc_comment.{cc,h} Deprecated annotation logic updated, new is_private parameter for doc comment functions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CodeGenerator
    participant MessageLayoutHelper
    participant FieldChunk
    participant MessageGenerator

    User->>CodeGenerator: Request code generation for proto file
    CodeGenerator->>MessageGenerator: Initialize message generation
    MessageGenerator->>FieldChunk: Collect and group fields by criteria
    FieldChunk-->>MessageGenerator: Return field chunks
    MessageGenerator->>MessageLayoutHelper: Optimize field layout using chunks
    MessageLayoutHelper-->>MessageGenerator: Return optimized field order
    MessageGenerator->>CodeGenerator: Generate C++ code with optimized layout
    CodeGenerator-->>User: Output generated C++ code
Loading

Suggested reviewers

  • juanarbol
  • RafaelGSS

Poem

In the warren of code, a rabbit hops,
Sorting fields in clever crops.
Chunks aligned, layouts tight,
Nulls and names all marked just right.
Tests abound, the build hops higher,
With every patch, this code’s on fire!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

🔭 Outside diff range comments (1)
deps/protobuf/src/google/protobuf/compiler/cpp/file.cc (1)

286-289: ⚠️ Potential issue

Incorrect #define – variable placeholder typo will leak literal dollar sign into generated files

The line

#define $dllexport_macro$$ dllexport_decl$

expands to something like

#define PROTOBUF_EXPORT$ dllexport_decl

because the second placeholder is malformed ($ dllexport_decl$, with a leading space) and the stray $ after the first placeholder is emitted verbatim.
Down-stream headers will therefore contain the literal characters $ dllexport_decl instead of the intended expansion of the dllexport_decl variable, breaking compilation.

-#define $dllexport_macro$$ dllexport_decl$
+#define $dllexport_macro$ $dllexport_decl$
🧹 Nitpick comments (25)
deps/protobuf/src/google/protobuf/bridge/message_set.proto (3)

33-33: Clarify file-level deprecation comment
The standalone // DEPRECATED: DO NOT USE FOR NEW FIELDS. before the syntax declaration may imply the entire file is deprecated, not just the MessageSet message. Consider specifying “MessageSet deprecated” or moving the notice closer to the message to avoid confusion.


43-49: Condense repeated deprecation block
The multi-line deprecation comment is clear, but it duplicates context and is quite verbose. You could merge into a single concise paragraph to improve readability, for example:

// DEPRECATED: MessageSet is obsolete. For proto2, define your own extendable messages;
// for proto3, use `Any`.  

62-63: Improve extension formatting
Splitting the range and its options over two lines is valid but non-standard. For clarity, merge them into one line:

- extensions 4 to max
- [verification = UNVERIFIED];
+ extensions 4 to max [verification = UNVERIFIED];
deps/protobuf/src/google/protobuf/compiler/java/doc_comment.h (1)

15-16: Remove unnecessary C header include.

The #include <stdbool.h> is unnecessary in C++ code since bool is a built-in type. This header is typically used in C code.

-#include <stdbool.h>
-
deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.h (1)

42-44: Prefer size_t for parallelism to prevent signed/unsigned mismatches

NumCPUs() returns an int, but the value ultimately controls container sizes and loop counters that are size_t elsewhere in the codebase (RunInParallel). Storing it in an int risks implicit casts and negative values if NumCPUs() ever fails and returns -1.

-  int parallelism = NumCPUs();
+  size_t parallelism = static_cast<size_t>(NumCPUs());
deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto_test.cc (1)

6-7: Duplicate include – remove the second file.h

Including the same header twice is redundant, increases compile time, and clutters diffs.

-#include "google/protobuf/testing/file.h"
deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc (1)

366-370: Logging every repeated field at INFO may flood logs

ABSL_LOG(INFO) inside the hot aggregation loop will emit one line per repeated field for every profile processed. At scale (e.g., fleet-wide aggregation) this generates large, mostly unhelpful output.

Consider demoting to VLOG(1) or gating behind an explicit verbose flag.

deps/protobuf/.bazelci/README.md (1)

3-3: Fix markdown formatting for the URL.

The bare URL should be formatted as a proper markdown link for better readability and consistency.

-The `.bazelci/presubmit.yml` file is used by https://buildkite.com/bazel/protobuf
+The `.bazelci/presubmit.yml` file is used by [Buildkite](https://buildkite.com/bazel/protobuf)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

3-3: Bare URL used
null

(MD034, no-bare-urls)

deps/protobuf/src/google/protobuf/compiler/command_line_interface.cc (1)

1251-1252: Validate new descriptor pool enforcement calls and test coverage

We added EnforceOptionDependencies(true) and EnforceNamingStyle(true) by default. Confirm these align with expected CLI behavior and won’t break existing workflows. Ensure that the corresponding unit tests (e.g., command_line_interface_unittest.cc) cover:

  • rejection of invalid option dependencies
  • enforcement of naming style violations

Also consider whether it’s worth exposing these as configurable flags rather than hard-coding to true.

deps/protobuf/src/google/protobuf/arenastring.cc (1)

10-18: Confirm necessity and ordering of added headers

New headers <atomic>, <cassert>, <cstdint>, <cstring>, <string>, <utility> and absl/base/const_init.h have been introduced. Verify each is required (e.g., <atomic> for std::atomic, <cassert> for ABSL_DCHECK) and remove any unused includes to keep compile times minimal.

deps/protobuf/src/google/protobuf/compiler/cpp/file.cc (1)

258-262: Variable rename: make sure all call-sites were updated

inline_fns was renamed to inline_defs in the template map, but only this location is visible here.
Search the rest of the codebase (especially GenerateSharedHeaderCode callers) for the old key to avoid runtime absl::StrFormat errors at code-generation time.

agents/grpc/src/proto/source_code.pb.h (1)

621-678: Getter now returns a const std::string& – consider string_view, but otherwise LGTM

Nothing functionally changed except the fully-qualified ::std::string and some minor inlining tweaks.
If you ever profile this hot path you might want a absl::string_view accessor instead of a reference (avoids forcing callers to copy / keeps header footprint smaller), but this is generated code so not actionable here.

deps/protobuf/src/google/protobuf/compiler/cpp/extension.cc (1)

129-158: Large base64 blob in header increases compile time & object size

Embedding the default-data string literal directly in every translation unit that includes the header:

  • Bloats object files.
  • Slows down compilation (the compiler has to parse a long string literal N times).

Prefer moving the constexpr array to the generated .cc file and keeping only an extern declaration in the header.

deps/protobuf/src/file_lists.cmake (1)

1462-1465: New test file for lazy dependency building.

The addition of lazily_build_dependencies_test.cc suggests new functionality for lazy dependency building. Ensure this feature is well-documented.

Would you like me to review the implementation of the lazy dependency building feature to ensure it's properly integrated?

deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.cc (1)

106-137: Add bounds checking for alignment size.

While the code has a FATAL log for unknown alignment sizes, it would be better to handle this more gracefully or at least document the expected alignment sizes.

Consider adding a helper function to validate alignment size:

+constexpr bool IsValidAlignmentSize(size_t size) {
+  return size == 1 || size == 4 || size == 8;
+}
+
 FieldAlignmentGroups
 MessageLayoutHelper::BuildFieldAlignmentGroups(
     const FieldVector& fields, const Options& options,
     MessageSCCAnalyzer* scc_analyzer) const {
   FieldAlignmentGroups field_alignment_groups;

   for (const auto* field : fields) {
     FieldFamily f = GetFieldFamily(field, options, scc_analyzer);

     FieldHotness hotness =
         GetFieldHotnessCategory(field, options, scc_analyzer);

     FieldGroup fg = SingleFieldGroup(field);
+    const size_t alignment = EstimateAlignmentSize(field);
+    ABSL_CHECK(IsValidAlignmentSize(alignment))
+        << "Unknown alignment size " << alignment << " for field "
+        << field->full_name() << ".";
     switch (EstimateAlignmentSize(field)) {
       case 1:
         field_alignment_groups.aligned_to_1[f][hotness].push_back(fg);
         break;
       case 4:
         field_alignment_groups.aligned_to_4[f][hotness].push_back(fg);
         break;
       case 8:
         field_alignment_groups.aligned_to_8[f][hotness].push_back(fg);
         break;
-      default:
-        ABSL_LOG(FATAL) << "Unknown alignment size "
-                        << EstimateAlignmentSize(field) << "for field "
-                        << field->full_name() << ".";
     }
   }

   return field_alignment_groups;
 }
deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_editions.proto (1)

19-19: Package directory mismatch with filename.

The static analysis tool correctly identifies that the package name edition_unittest doesn't match the directory structure. The file is located in deps/protobuf/src/google/protobuf/compiler/cpp/ but should be in a directory matching the package name for consistency.

Consider either:

  1. Moving this file to an edition_unittest subdirectory, or
  2. Changing the package name to match the current directory structure (e.g., google.protobuf.compiler.cpp)
🧰 Tools
🪛 Buf (1.54.0)

19-19: Files with package "edition_unittest" must be within a directory "edition_unittest" relative to root but were in directory "deps/protobuf/src/google/protobuf/compiler/cpp".

(PACKAGE_DIRECTORY_MATCH)

deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.h (4)

15-19: Consider documenting the added standard headers.

The addition of <array>, <cstddef>, <cstdint>, and <vector> headers suggests new functionality. Consider adding a brief comment explaining why these specific headers are now required.


54-54: Add const qualifier to EstimateMemorySize method.

The comment mentions that field sizes are powers of 2, but this constraint should be documented more prominently or enforced in the code.

Consider adding a debug assertion to verify that field sizes are indeed powers of 2 when fields are added to the group.


90-99: Consider consolidating kCold and kSplit as mentioned in TODO.

The TODO comment indicates that kCold and kSplit should be merged once all field types can be split. This suggests ongoing refactoring work.

Would you like me to help identify which field types still need split support and create a plan for consolidating these hotness categories?


201-209: Static helper method could benefit from unit tests.

The ConsolidateAlignedFieldGroups method performs complex field grouping logic. Ensure this has comprehensive unit test coverage, especially for edge cases.

Consider adding debug assertions to verify the preconditions:

 static std::array<std::vector<FieldGroup>, kMaxHotness>
 ConsolidateAlignedFieldGroups(
     std::array<std::vector<FieldGroup>, kMaxHotness>& field_groups,
     size_t alignment, size_t target_alignment) {
+  ABSL_DCHECK_LT(alignment, target_alignment);
+  ABSL_DCHECK((alignment & (alignment - 1)) == 0);  // Power of 2
+  ABSL_DCHECK((target_alignment & (target_alignment - 1)) == 0);  // Power of 2
deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc (1)

653-656: Elegant template-based API simplification.

The refactoring to use templated forwarding methods for setters and adders is a significant improvement. This reduces code duplication while maintaining type safety through perfect forwarding.

Consider adding a comment explaining the BytesTag parameter usage:

 template <typename Arg_>
 inline void $Msg$::set_$name$(int index, Arg_&& value) {
   $WeakDescriptorSelfPin$;
+  // BytesTag is used to select the appropriate overload for byte fields
   $pbi$::AssignToString(*$mutable$, ::std::forward<Arg_>(value) $bytes_tag$);

Also applies to: 690-701

deps/protobuf/src/google/protobuf/BUILD.bazel (1)

1573-1595: New test lazily_build_dependencies_test – mark as manual to keep CI times stable

This test exercises lazy-build scenarios but is added without a size or tag override. For very large workspaces (like nsolid) this can add several seconds to every CI run.

-cc_test(
-    name = "lazily_build_dependencies_test",
+cc_test(
+    name = "lazily_build_dependencies_test",
+    tags = ["manual"],

Adding manual keeps the test available without making it part of the default bazel test //... sweep.

deps/protobuf/src/google/protobuf/compiler/command_line_interface_unittest.cc (1)

37-38: Remove duplicate include to avoid -Werror=duplicate-include warnings

google/protobuf/testing/file.h is included twice consecutively. Some build configurations compiled with -Werror (e.g. Clang) treat duplicate includes as an error. Keeping a single include is sufficient.

-#include "google/protobuf/testing/file.h"
+#include "google/protobuf/testing/file.h"  // (kept once – duplicate removed)
-#include "google/protobuf/testing/file.h"
deps/protobuf/src/google/protobuf/compiler/cpp/message.cc (2)

578-580: Duplicate type-alias using Sub adds noise

using Sub = ::google::protobuf::io::Printer::Sub; appears twice (line 71 and again at line 578).
The second declaration is redundant and may confuse code-readers or trigger a shadow-warning with some compilers.

-using Sub = ::google::protobuf::io::Printer::Sub;

885-899: Header for <type_traits> should be included explicitly

std::enable_if_t is now used directly (lines 885-899, 971-989), but
<type_traits> is not included in this compilation unit.
Relying on transitive includes is brittle and may break when upstream headers
change.

+#include <type_traits>

Place it with the other standard headers.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 308046b and c820f89.

⛔ Files ignored due to path filters (16)
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/logs/v1/logs_service.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/logs/v1/logs_service.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/metrics/v1/metrics_service.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/trace/v1/trace_service.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/trace/v1/trace_service.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/common/v1/common.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/common/v1/common.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/logs/v1/logs.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/logs/v1/logs.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/metrics/v1/metrics.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/metrics/v1/metrics.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/resource/v1/resource.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/resource/v1/resource.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/trace/v1/trace.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/trace/v1/trace.pb.h is excluded by !**/gen/**
📒 Files selected for processing (116)
  • agents/grpc/src/proto/asset.pb.cc (7 hunks)
  • agents/grpc/src/proto/asset.pb.h (7 hunks)
  • agents/grpc/src/proto/blocked_loop.pb.cc (23 hunks)
  • agents/grpc/src/proto/blocked_loop.pb.h (14 hunks)
  • agents/grpc/src/proto/command.pb.cc (16 hunks)
  • agents/grpc/src/proto/command.pb.h (19 hunks)
  • agents/grpc/src/proto/common.pb.cc (15 hunks)
  • agents/grpc/src/proto/common.pb.h (16 hunks)
  • agents/grpc/src/proto/exit.pb.cc (15 hunks)
  • agents/grpc/src/proto/exit.pb.h (16 hunks)
  • agents/grpc/src/proto/info.pb.cc (20 hunks)
  • agents/grpc/src/proto/info.pb.h (36 hunks)
  • agents/grpc/src/proto/metrics.pb.cc (8 hunks)
  • agents/grpc/src/proto/metrics.pb.h (4 hunks)
  • agents/grpc/src/proto/nsolid_service.pb.cc (6 hunks)
  • agents/grpc/src/proto/nsolid_service.pb.h (7 hunks)
  • agents/grpc/src/proto/packages.pb.cc (15 hunks)
  • agents/grpc/src/proto/packages.pb.h (20 hunks)
  • agents/grpc/src/proto/profile.pb.cc (16 hunks)
  • agents/grpc/src/proto/profile.pb.h (7 hunks)
  • agents/grpc/src/proto/reconfigure.pb.cc (11 hunks)
  • agents/grpc/src/proto/reconfigure.pb.h (16 hunks)
  • agents/grpc/src/proto/source_code.pb.cc (12 hunks)
  • agents/grpc/src/proto/source_code.pb.h (15 hunks)
  • agents/grpc/src/proto/startup_times.pb.cc (7 hunks)
  • agents/grpc/src/proto/startup_times.pb.h (4 hunks)
  • deps/protobuf/.bazelci/README.md (1 hunks)
  • deps/protobuf/.bazelci/presubmit.yml (1 hunks)
  • deps/protobuf/.bazelrc (1 hunks)
  • deps/protobuf/.bcr/metadata.template.json (0 hunks)
  • deps/protobuf/.bcr/presubmit.yml (2 hunks)
  • deps/protobuf/protobuf.gyp (2 hunks)
  • deps/protobuf/src/file_lists.cmake (26 hunks)
  • deps/protobuf/src/google/protobuf/BUILD.bazel (24 hunks)
  • deps/protobuf/src/google/protobuf/any.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/any.h (3 hunks)
  • deps/protobuf/src/google/protobuf/any.pb.cc (8 hunks)
  • deps/protobuf/src/google/protobuf/any.pb.h (10 hunks)
  • deps/protobuf/src/google/protobuf/any_lite.cc (4 hunks)
  • deps/protobuf/src/google/protobuf/api.pb.cc (21 hunks)
  • deps/protobuf/src/google/protobuf/api.pb.h (29 hunks)
  • deps/protobuf/src/google/protobuf/arena.cc (2 hunks)
  • deps/protobuf/src/google/protobuf/arena.h (23 hunks)
  • deps/protobuf/src/google/protobuf/arena_align.cc (0 hunks)
  • deps/protobuf/src/google/protobuf/arena_cleanup.h (3 hunks)
  • deps/protobuf/src/google/protobuf/arenastring.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/arenaz_sampler.h (3 hunks)
  • deps/protobuf/src/google/protobuf/bridge/message_set.proto (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/BUILD.bazel (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/code_generator.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/code_generator.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/code_generator_unittest.cc (6 hunks)
  • deps/protobuf/src/google/protobuf/compiler/command_line_interface.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/command_line_interface_unittest.cc (19 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/BUILD.bazel (7 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/bootstrap_unittest.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/copy_unittest.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/enum.cc (8 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/extension.cc (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/extension.h (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field.h (4 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk.h (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk_test.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/cord_field.cc (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/enum_field.cc (5 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/map_field.cc (4 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/message_field.cc (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc (4 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/string_field.cc (15 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc (13 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/file.cc (8 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/helpers.cc (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/helpers.h (4 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/message.cc (27 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/message.h (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/move_unittest.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/options.h (0 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/padding_optimizer.cc (0 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/padding_optimizer.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.cc (5 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_editions.proto (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_proto2.proto (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc (11 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto_main.cc (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto_test.cc (4 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/tracker.cc (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/unittest.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/cpp/unittest.inc (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_enum.h (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.h (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_generator.h (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_message.h (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_options.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.h (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.h (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.h (3 hunks)
  • deps/protobuf/src/google/protobuf/compiler/csharp/names.cc (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/java/BUILD.bazel (4 hunks)
  • deps/protobuf/src/google/protobuf/compiler/java/doc_comment.cc (2 hunks)
  • deps/protobuf/src/google/protobuf/compiler/java/doc_comment.h (2 hunks)
💤 Files with no reviewable changes (4)
  • deps/protobuf/.bcr/metadata.template.json
  • deps/protobuf/src/google/protobuf/arena_align.cc
  • deps/protobuf/src/google/protobuf/compiler/cpp/options.h
  • deps/protobuf/src/google/protobuf/compiler/cpp/padding_optimizer.cc
🧰 Additional context used
🧬 Code Graph Analysis (3)
agents/grpc/src/proto/asset.pb.cc (1)
agents/grpc/src/proto/asset.pb.h (20)
  • Asset (78-78)
  • Asset (78-78)
  • Asset (79-79)
  • Asset (89-89)
  • Asset (91-91)
  • Asset (91-91)
  • Asset (92-93)
  • Asset (92-92)
  • Asset (197-197)
  • Asset (198-198)
  • Asset (199-203)
  • Asset (409-427)
  • Asset (409-409)
  • Asset (428-436)
  • Asset (428-428)
  • Asset (437-444)
  • _impl_ (185-185)
  • GetClassData (204-204)
  • swap (131-131)
  • swap (131-131)
agents/grpc/src/proto/reconfigure.pb.cc (1)
agents/grpc/src/proto/reconfigure.pb.h (31)
  • ReconfigureBody (78-721)
  • ReconfigureBody (81-81)
  • ReconfigureBody (81-81)
  • ReconfigureBody (82-82)
  • ReconfigureBody (92-92)
  • ReconfigureBody (94-94)
  • ReconfigureBody (94-94)
  • ReconfigureBody (95-96)
  • ReconfigureBody (95-95)
  • ReconfigureBody (200-200)
  • ReconfigureBody (201-201)
  • ReconfigureBody (202-206)
  • _impl_ (188-188)
  • _impl_ (549-549)
  • ReconfigureEvent (442-442)
  • ReconfigureEvent (442-442)
  • ReconfigureEvent (443-443)
  • ReconfigureEvent (453-453)
  • ReconfigureEvent (455-455)
  • ReconfigureEvent (455-455)
  • ReconfigureEvent (456-457)
  • ReconfigureEvent (456-456)
  • ReconfigureEvent (561-561)
  • ReconfigureEvent (562-562)
  • ReconfigureEvent (563-567)
  • GetClassData (207-207)
  • GetClassData (568-568)
  • swap (134-134)
  • swap (134-134)
  • swap (495-495)
  • swap (495-495)
agents/grpc/src/proto/info.pb.cc (1)
agents/grpc/src/proto/info.pb.h (30)
  • InfoBody (125-823)
  • InfoBody (128-128)
  • InfoBody (128-128)
  • InfoBody (129-129)
  • InfoBody (139-139)
  • InfoBody (141-141)
  • InfoBody (141-141)
  • InfoBody (142-143)
  • InfoBody (142-142)
  • InfoBody (247-247)
  • InfoBody (248-248)
  • InfoBody (249-253)
  • InfoEvent (564-564)
  • InfoEvent (564-564)
  • InfoEvent (565-565)
  • InfoEvent (575-575)
  • InfoEvent (577-577)
  • InfoEvent (577-577)
  • InfoEvent (578-579)
  • InfoEvent (578-578)
  • InfoEvent (683-683)
  • InfoEvent (684-684)
  • InfoEvent (685-689)
  • GetClassData (116-116)
  • GetClassData (254-254)
  • GetClassData (690-690)
  • swap (181-181)
  • swap (181-181)
  • swap (617-617)
  • swap (617-617)
🪛 markdownlint-cli2 (0.17.2)
deps/protobuf/.bazelci/README.md

3-3: Bare URL used
null

(MD034, no-bare-urls)

🪛 Buf (1.54.0)
deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_editions.proto

19-19: Files with package "edition_unittest" must be within a directory "edition_unittest" relative to root but were in directory "deps/protobuf/src/google/protobuf/compiler/cpp".

(PACKAGE_DIRECTORY_MATCH)

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: build-tarball
  • GitHub Check: coverage-windows
  • GitHub Check: lint-js-and-md
  • GitHub Check: test-linux (ubuntu-24.04)
  • GitHub Check: test-linux (ubuntu-24.04-arm)
  • GitHub Check: coverage-linux-without-intl
  • GitHub Check: build-docs
  • GitHub Check: coverage-linux
  • GitHub Check: test-macOS
🔇 Additional comments (375)
deps/protobuf/src/google/protobuf/compiler/cpp/bootstrap_unittest.cc (1)

100-100: Modernize allocation to use std::make_unique
Using std::make_unique<std::string>() instead of reset(new std::string) improves exception safety and readability without changing behavior.

deps/protobuf/src/google/protobuf/arenaz_sampler.h (3)

8-9: Approve simplified include guard macros
The updated guard (GOOGLE_PROTOBUF_ARENAZ_SAMPLER_H__) is concise and aligns with the filename.


138-139: Approve marking swap as noexcept
Adding noexcept to the friend swap improves exception safety guarantees for move operations.


238-238: Approve updated closing #endif
The closing #endif now correctly matches the new include guard.

deps/protobuf/src/google/protobuf/bridge/message_set.proto (1)

59-59: Mark MessageSet as deprecated
Applying option deprecated = true; at the message level is correct and ensures compilers will emit warnings on use.

deps/protobuf/src/google/protobuf/compiler/java/doc_comment.h (2)

58-59: Well-designed parameter addition with backward compatibility.

The addition of the is_private parameter with a default value of false maintains backward compatibility while enabling the new functionality to skip deprecated javadoc for private accessors.


65-66: Consistent parameter addition across related functions.

Good consistency in adding the same is_private parameter to both WriteFieldAccessorDocComment and WriteFieldStringBytesAccessorDocComment functions.

deps/protobuf/src/google/protobuf/compiler/java/doc_comment.cc (4)

279-279: Function signature updated correctly.

The function signature properly implements the new is_private parameter, matching the header declaration.


283-285: Appropriate conditional logic for skipping deprecated javadoc.

The condition if (!kdoc && !is_private) correctly implements the intended behavior - deprecated javadoc is skipped for both Kotlin docs and private accessors. This makes sense since private accessors typically don't need deprecated annotations in their documentation.


407-410: Consistent function signature update.

The function signature is properly updated to match the header declaration, maintaining consistency with the related WriteFieldAccessorDocComment function.


414-416: Consistent implementation of conditional logic.

The same conditional check is properly applied here, ensuring consistent behavior across both WriteFieldAccessorDocComment and WriteFieldStringBytesAccessorDocComment functions.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_options.h (1)

8-9: Include guard updated for consistency

Renamed the macro to include an extra CSHARP_ segment, aligning with the pattern used in other C# compiler headers and avoiding potential conflicts.

Also applies to: 60-60

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.h (1)

8-9: Include guard macro renamed

Updated the guard to reflect the full file path with a double CSHARP_ prefix, matching the naming convention across C# codegen headers.

Also applies to: 33-33

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.h (1)

12-13: Include guard updated to match naming pattern

The renamed macro now includes the extra CSHARP_ segment, ensuring consistency with other C# generator header guards.

Also applies to: 143-143

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc (1)

41-41: Use character literal for line splitting

Switching from a string literal to a char delimiter ('\n') leverages the dedicated overload of absl::StrSplit, avoiding unnecessary string construction and improving efficiency.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h (1)

8-9: Include guard macro standardized

Renamed the guard to include an additional CSHARP_ token for clear file path reflection and consistency across all C# compiler headers.

Also applies to: 47-47

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_enum.h (2)

8-9: Include guard updated for consistency
The guard macro now reflects the full path (csharp/csharp_enum.h) and matches at both #ifndef and #endif.

Also applies to: 42-42


26-26: Destructor correctly marked override
Adding the override specifier ensures the destructor signature matches the base class.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.h (2)

8-9: Include guard renamed to match file path
The new guard GOOGLE_PROTOBUF_COMPILER_CSHARP_CSHARP_FIELD_BASE_H__ aligns with the header’s location and is consistent.

Also applies to: 93-93


33-33: Destructor marked override
Explicitly overriding the base destructor improves clarity and enforces correct overriding.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc (2)

197-198: Preallocate extensions vector in WriteDescriptor
Calling extensions.reserve(file_->extension_count()) avoids multiple reallocations when populating file-level extensions.


300-301: Preallocate extensions vector in WriteGeneratedCodeInfo
Using extensions.reserve(descriptor->extension_count()) optimizes vector growth for message-level extensions.

deps/protobuf/src/google/protobuf/compiler/csharp/names.cc (2)

172-174: Use .empty() instead of size() > 0
Replacing input.size() > 0 with !input.empty() enhances readability and intent clarity.


187-190: Check string emptiness with .empty()
Swapping result.size() > 0 and input.size() > 0 for !result.empty() and !input.empty() refines the style without altering behavior.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_generator.h (2)

10-11: Include guard updated to reflect header path
The guard GOOGLE_PROTOBUF_COMPILER_CSHARP_CSHARP_GENERATOR_H__ now matches the file’s location and is consistent.

Also applies to: 50-50


31-31: Destructor declared with override
Marking ~Generator() as override enforces correct overriding of the base class destructor.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.h (3)

8-9: Improved include guard naming for consistency.

The include guard macro now better reflects the file path structure by including the extra CSHARP_ segment, improving clarity and reducing potential naming conflicts.


26-26: Good modernization with explicit override specifier.

Adding the override specifier to the destructor makes the inheritance relationship explicit and helps prevent potential issues if the base class interface changes.


52-52: Include guard end updated consistently.

The closing include guard macro correctly matches the updated opening guard.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_message.h (3)

8-9: Consistent include guard naming improvement.

The renamed include guard macro follows the same improved naming convention applied across the C# compiler headers.


28-28: Explicit override specifier for destructor.

Using override makes the inheritance relationship clear and follows modern C++ best practices.


70-70: Include guard closure updated correctly.

The closing guard macro properly matches the updated opening guard.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.h (4)

8-9: Include guard naming follows established pattern.

The renamed macro maintains consistency with the other C# compiler headers.


26-26: Destructors properly marked with override.

Both class destructors now explicitly indicate they override base class destructors, following modern C++ guidelines.

Also applies to: 53-53


31-43: Method declarations modernized effectively.

Removing the redundant virtual keyword while retaining override follows modern C++ style guidelines. The override specifier already implies virtual behavior and provides better compiler checking.

Also applies to: 59-63


71-71: Include guard closure updated consistently.

The closing macro properly reflects the updated naming convention.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.h (4)

8-9: Include guard naming completed consistently.

The final header in this set maintains the improved naming convention established across the C# compiler headers.


24-24: Destructor override specifier applied correctly.

The destructor now explicitly indicates it overrides the base class, completing the modernization pattern.


29-43: Virtual method declarations follow modern style.

The removal of redundant virtual keywords while preserving override specifiers improves code clarity and follows current C++ best practices.


51-51: Include guard properly closed.

The closing guard macro correctly matches the updated naming convention.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h (4)

8-9: Include guard macro rename: The include guard has been updated to include the extra CSHARP_ segment, aligning the macro name with the file path and maintaining consistency across C# generator headers.


23-23: Destructor marked override: Explicitly marking the destructor with override clarifies intent and ensures correct override behavior.


28-43: Removed redundant virtual and retained override on methods: Overridden methods now consistently use override without the redundant virtual keyword, following modern C++ best practices.


51-51: Closing guard comment updated: The #endif comment matches the new guard macro, preserving consistency.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h (4)

8-9: Include guard updated for consistency: Renamed to include the extra CSHARP_ prefix, matching the file’s path and other C# headers.


26-26: Destructor declared with override: Improves clarity on the destructor’s override of the base class.


32-47: Cleaned up method declarations: All methods drop the redundant virtual keyword and retain override, aligning with modern style guidelines.


55-55: Closing include guard adjusted: The #endif comment now reflects the updated macro name.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.h (6)

8-9: Include guard rename: Guard macro now includes the extra CSHARP_ segment, consistent with other C# compiler headers.


24-24: Destructor marked override: Explicit override specifier added for improved readability and correctness.


29-33: EnumFieldGenerator methods cleaned up: Removed redundant virtual keywords and retained override on all method declarations.


41-41: Oneof destructor override: The EnumOneofFieldGenerator destructor is now explicitly marked override.


46-49: EnumOneofFieldGenerator methods modernized: All overridden methods drop virtual and keep override, matching style elsewhere.


57-57: Closing guard comment corrected: Matches the new include guard macro name.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.h (6)

8-9: Include guard updated: Added the extra CSHARP_ prefix to the macro for path consistency.


24-24: Destructor explicitly override: Improves clarity that this destructor overrides the base.


29-42: MessageFieldGenerator methods cleaned up: All method declarations remove virtual and retain override, following modern C++ conventions.


49-49: MessageOneofFieldGenerator destructor override: Marked with override to clarify override intent.


55-60: Oneof field methods modernized: Dropped redundant virtual and kept override on all methods.


67-67: Closing include guard aligned: The #endif comment now matches the renamed guard macro.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.h (6)

8-9: Include guard rename: Macro now includes an extra CSHARP_ segment, matching file structure and other headers.


26-26: Destructor override added: Clarifies override of base destructor.


31-46: WrapperFieldGenerator methods cleaned up: Removed redundant virtual, retained override across all method declarations.


57-57: WrapperOneofFieldGenerator destructor override: Marked with override for consistency and clarity.


62-70: Oneof wrapper methods modernized: All overridden methods now use override without virtual.


78-78: Closing guard comment updated: Reflects the updated include guard macro name.

deps/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h (3)

8-9: Header guard update matches file path and name.

The new macro GOOGLE_PROTOBUF_COMPILER_CSHARP_CSHARP_REPEATED_MESSAGE_FIELD_H__ correctly reflects both the directory (csharp) and the filename (csharp_repeated_message_field.h). The corresponding #endif comment was also updated.

Also applies to: 55-55


26-26: Destructor marked override and virtual removed.

Switching to ~RepeatedMessageFieldGenerator() override; and dropping the redundant virtual aligns with modern C++ best practices for override specifiers.


32-47: Removed redundant virtual keywords and added override.

All overridden methods now use the override specifier alone, improving clarity and ensuring mismatches are caught at compile time.

deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto_main.cc (3)

42-57: Well-designed flag additions with good defaults.

The new flags enhance the tool's functionality significantly:

  • print_unused_threshold and print_optimized provide granular output control
  • out_file enables file output redirection
  • sort_output_by_file_name offers organized output formatting
  • parallelism with NumCPUs() default is a smart choice for performance

The flag documentation is clear and comprehensive.


66-82: Robust argument validation and output handling.

The enhanced argument validation using ABSL_QCHECK_EQ with a descriptive usage message is excellent. The file output handling is well-implemented with proper error checking and resource management. The choice between stdout and file output is handled cleanly.


84-106: Comprehensive options configuration and improved error handling.

The options struct initialization is thorough, capturing all the new flags and providing a clean interface to the analysis functions. The conditional logic for choosing between single profile analysis and aggregated analysis is clear. Error handling has been improved with descriptive logging and proper exit codes.

deps/protobuf/src/google/protobuf/compiler/BUILD.bazel (2)

18-21: LGTM - Bootstrap compiler integration.

The addition of the bootstrap_cc_library load statement aligns with the protobuf build system's integration of UPB generator components.


220-248:

❓ Verification inconclusive

Verify the bootstrap build system changes work correctly.

The change from cc_library to bootstrap_cc_library for the protoc_lib target is a significant build system modification. This introduces a bootstrap compilation approach with new UPB generator dependencies.

Please verify that the build system changes function correctly by running:


🏁 Script executed:

#!/bin/bash
# Description: Verify that the protoc_lib target builds successfully with the new bootstrap approach
# Expected: Successful build of protoc_lib and its dependencies

# Test building the protoc_lib target
cd deps/protobuf
bazel build //src/google/protobuf/compiler:protoc_lib

# Test building the full protoc binary to ensure end-to-end compatibility
bazel build //src/google/protobuf/compiler:protoc

# Verify the bootstrap dependency is available
bazel query 'deps(//src/google/protobuf/compiler:protoc_lib)' | grep upb_generator

Length of output: 501


Manual verification required: Bazel unavailable in current environment

I wasn’t able to run the Bazel commands here (no bazel binary), so please verify the bootstrap build changes locally:

  • Build the protoc_lib target with the new bootstrap_cc_library rule.
  • Build the full protoc binary end-to-end.
  • Confirm that the UPB generator dependency is present:
    bazel query 'deps(//src/google/protobuf/compiler:protoc_lib)' | grep upb_generator
deps/protobuf/src/google/protobuf/compiler/cpp/move_unittest.cc (1)

12-12: LGTM - Consistent include addition.

The addition of unittest_import.pb.h aligns with similar changes in other unittest files and likely supports expanded test coverage for imported protobuf definitions.

deps/protobuf/src/google/protobuf/compiler/cpp/copy_unittest.cc (1)

13-13: LGTM - Consistent with other unittest files.

The include addition matches the identical change in move_unittest.cc, ensuring consistent access to imported protobuf definitions across test files.

deps/protobuf/src/google/protobuf/compiler/cpp/unittest.cc (1)

29-29: LGTM: Test coverage improvement

The addition of unittest_import.pb.h aligns with the broader pattern of ensuring comprehensive test coverage for imported protobuf definitions mentioned in the AI summary.

deps/protobuf/src/google/protobuf/compiler/cpp/extension.h (1)

94-94: LGTM: Include guard comment fix

Correctly updates the include guard comment to match the actual filename (extension.h instead of incorrectly referencing message.h).

deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/message_field.cc (2)

29-30: LGTM: Port macro setup

Proper addition of port_def.inc to ensure consistent platform-specific macro definitions.


1067-1067: LGTM: Port macro cleanup

Correctly adds port_undef.inc to clean up platform-specific macros, completing the bracketing pattern with the corresponding port_def.inc include.

deps/protobuf/src/google/protobuf/compiler/code_generator.cc (1)

108-109: LGTM: Expanded edition check bypass

Adding "com/google/protobuf/" as an additional prefix for bypassing edition validation is consistent with the existing pattern for internal protobuf files and aligns with the enhanced edition handling in this update.

deps/protobuf/.bazelrc (1)

6-8: Ensure Rust linking flag is scoped appropriately
The experimental_use_cc_common_link flag is now applied globally under build; confirm this doesn't unintentionally affect non-Rust targets or downstream platforms (e.g., macOS where the removed BAZEL_NO_APPLE_CPP_TOOLCHAIN workaround was important).

deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_proto2.proto (1)

33-35: Verify C++ codegen handles std message correctly
Introducing a nested message named std may conflict with the C++ std namespace. Ensure all generated identifiers are fully qualified (e.g., ::std) and there are no namespace collisions in the C++ output.

agents/grpc/src/proto/metrics.pb.h (2)

4-4: LGTM: Protobuf version update is consistent.

The version update from 6.30.2 to 6.31.1 is correctly reflected in both the comment and the runtime version check macro, ensuring proper version validation.

Also applies to: 15-15


97-97: LGTM: Explicit namespace qualification improves code robustness.

The change from std::move to ::std::move ensures unambiguous resolution to the standard library function and prevents potential namespace conflicts.

Also applies to: 294-294

deps/protobuf/.bcr/presubmit.yml (1)

1-1: LGTM: Expanding platform coverage with macOS ARM64 support.

Adding "macos_arm64" to the platform matrix improves test coverage across different architectures. The lint markers ensure consistency with related configuration files.

Also applies to: 5-5, 22-22

deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/map_field.cc (2)

12-12: LGTM: Adding necessary Abseil logging header.

The absl/log/absl_check.h include is needed for ABSL_CHECK functionality used in the code.


23-25: LGTM: Consistent port definition management pattern.

The addition of port_def.inc and port_undef.inc includes follows the consistent pattern across protobuf compiler files for managing platform-specific macros and compiler settings.

Also applies to: 334-334

agents/grpc/src/proto/startup_times.pb.h (3)

4-4: LGTM: Consistent protobuf version update.

Version update from 6.30.2 to 6.31.1 is correctly applied in both the comment and runtime check macro.

Also applies to: 15-15


34-34: LGTM: Header include updated to align with protobuf changes.

The change from map_field_inl.h to map_field.h aligns with protobuf library restructuring in version 31.1.


139-139: LGTM: Explicit namespace qualification applied consistently.

The change to ::std::move maintains consistency with namespace qualification improvements across protobuf-generated code.

deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/cord_field.cc (1)

29-31: LGTM: Consistent port definition include pattern.

The addition of port_def.inc and port_undef.inc follows the established pattern across protobuf compiler files for managing platform-specific macros and compiler settings.

Also applies to: 479-479

deps/protobuf/src/google/protobuf/compiler/cpp/tracker.cc (2)

225-225: LGTM: Clean refactoring to use descriptive function.

The replacement of the enum comparison with IsArenaStringPtr(field) improves code readability and likely encapsulates more complex logic for arena string pointer detection.


244-244: LGTM: Consistent application of the new string field detection.

The changes consistently apply the same IsArenaStringPtr(field) logic across both string field pointer determination and default field name handling in the StringOneofGetters function.

Also applies to: 253-253

deps/protobuf/src/google/protobuf/compiler/cpp/enum.cc (1)

63-63: LGTM: Systematic namespace qualification improvements.

The addition of explicit global namespace qualification (::) to standard library and Abseil types ensures unambiguous references and prevents potential naming conflicts. This is consistent with the broader protobuf compiler standardization effort described in the PR.

Also applies to: 172-174, 224-225, 265-265, 274-274, 359-359, 529-529, 556-556

deps/protobuf/.bazelci/presubmit.yml (1)

1-21: LGTM: Comprehensive CI configuration for protobuf verification.

The Bazel CI configuration provides good coverage across platforms (debian10, macos, macos_arm64, ubuntu2004, windows) and Bazel versions (7.x, 8.x). The build targets appropriately cover core protobuf libraries, language bindings, and the protoc compiler, ensuring thorough verification of the protobuf update.

deps/protobuf/src/google/protobuf/compiler/java/BUILD.bazel (3)

75-75: LGTM: Addition of Abseil status dependency.

The addition of "@abseil-cpp//absl/status" to both the helpers and java libraries suggests enhanced error handling capabilities, which is a positive improvement for the Java code generator.

Also applies to: 165-165


88-88: LGTM: Build configuration alignment.

Adding copts = COPTS to the internal_helpers library aligns it with other libraries in the build file, ensuring consistent compilation options across all components.


222-226: LGTM: Enhanced test coverage and dependencies.

The addition of protobuf testing utilities and Abseil libraries to the generator_unittest target improves test capabilities and coverage, which is beneficial for ensuring the reliability of the Java code generator.

deps/protobuf/src/google/protobuf/compiler/cpp/field.h (2)

32-34: Add port_def.inc include for macro setup.
Including port_def.inc immediately after the header includes ensures platform-specific macros are defined correctly for this translation unit.


549-550: Add port_undef.inc include for macro teardown.
Bracketing the header content with port_def.inc and port_undef.inc cleanly restores macros to their prior state, preventing leakage into other code.

agents/grpc/src/proto/blocked_loop.pb.h (1)

4-2141: Skip review for generated code.
This header is auto-generated by the Protocol Buffers compiler. The namespace qualifications, version bump, and port includes align with the updated protobuf runtime. No manual changes required.

deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc (4)

28-28: Include wire_format_lite.h for lite constants.
This import is necessary to access WireFormatLite constants used in size and serialization routines.


30-31: Add port_def.inc include for macro setup.
Ensures platform-specific macros are properly defined before any implementation code.


668-669: Add port_undef.inc include for macro teardown.
Cleanly restores macro definitions after the implementation to avoid cross-file contamination.


616-616: Fully qualify size_t references.
Replaced ambiguous size_t with ::size_t for explicit global namespace qualification, matching the surrounding protobuf C++ style.

Also applies to: 637-637

deps/protobuf/src/google/protobuf/compiler/cpp/unittest.inc (2)

44-44: Header include order change looks appropriate.

The placement of gtest.h after gmock.h follows common C++ testing conventions.


58-58: Header repositioning is consistent with test infrastructure changes.

Moving unittest_no_generic_services.pb.h later in the include list appears to be organizational cleanup.

deps/protobuf/protobuf.gyp (3)

159-159:

✅ Verification successful

Verify the new field_chunk.cc source file exists.

Adding field_chunk.cc to the C++ code generator represents new field chunking capabilities in protobuf 31.1.


🏁 Script executed:

#!/bin/bash
# Description: Verify the new field_chunk.cc source file exists
# Expected: File should be present in the C++ compiler directory

echo "Checking for field_chunk.cc:"
fd "field_chunk.cc" deps/protobuf/src/google/protobuf/compiler/cpp/

echo "Checking if it's a legitimate C++ compiler source file:"
if [ -f "deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk.cc" ]; then
    echo "File exists. First few lines:"
    head -10 "deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk.cc"
else
    echo "File not found!"
fi

Length of output: 742


field_chunk.cc confirmed
The file deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk.cc exists and contains the expected implementation. Approving the addition of field_chunk.cc for protobuf 31.1.


67-67:

✅ Verification successful

Verify the new micro_string.cc source file exists.

Adding micro_string.cc to the protobuf static library sources appears to introduce string optimization features in protobuf 31.1.


🏁 Script executed:

#!/bin/bash
# Description: Verify the new micro_string.cc source file exists
# Expected: File should be present in the protobuf source directory

echo "Checking for micro_string.cc:"
fd "micro_string.cc" deps/protobuf/src/google/protobuf/

echo "Checking if it's a legitimate protobuf source file:"
if [ -f "deps/protobuf/src/google/protobuf/micro_string.cc" ]; then
    echo "File exists. First few lines:"
    head -10 "deps/protobuf/src/google/protobuf/micro_string.cc"
else
    echo "File not found!"
fi

Length of output: 825


Verified micro_string.cc presence

  • deps/protobuf/src/google/protobuf/micro_string.cc exists and its contents match the expected Protobuf source.

No further action needed; approving this addition.


162-162:

✅ Verification successful

Verify the new message_layout_helper.cc source file exists.

Adding message_layout_helper.cc to the C++ code generator introduces message layout optimization features, likely replacing the removed padding_optimizer.cc.


🏁 Script executed:

#!/bin/bash
# Description: Verify the new message_layout_helper.cc source file exists and padding_optimizer.cc is removed
# Expected: message_layout_helper.cc should exist, padding_optimizer.cc should not

echo "Checking for message_layout_helper.cc:"
fd "message_layout_helper.cc" deps/protobuf/src/google/protobuf/compiler/cpp/

echo "Checking for old padding_optimizer.cc (should not exist):"
fd "padding_optimizer.cc" deps/protobuf/src/google/protobuf/compiler/cpp/

echo "Verifying message_layout_helper.cc content:"
if [ -f "deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.cc" ]; then
    echo "File exists. First few lines:"
    head -10 "deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.cc"
else
    echo "File not found!"
fi

Length of output: 1000


✅ Verified message_layout_helper.cc inclusion and padding_optimizer.cc removal

  • deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.cc exists
  • padding_optimizer.cc is no longer present in that directory
agents/grpc/src/proto/exit.pb.h (7)

4-4: Update Protobuf C++ version stamp
Header comment reflects the bumped compiler version (6.31.1) per the PR objective.


15-19: Bump Protobuf runtime version check
The #if PROTOBUF_VERSION guard is updated to 6031001, matching the new codegen/runtime version.


100-100: Qualify std::move with global namespace
Constructor initializer now uses ::std::move, consistent with other generated code.


231-236: Fully qualify std::string in message accessors
Public getters/setters for the message field now explicitly use ::std::string.


238-240: Fully qualify internal message helpers
Internal methods (_internal_message, _internal_set_message, _internal_mutable_message) use ::std::string.


245-250: Fully qualify std::string in stack accessors
Public getters/setters for the stack field now explicitly use ::std::string.


253-255: Fully qualify internal stack helpers
Private helpers (_internal_stack, _internal_set_stack, _internal_mutable_stack) use ::std::string.

agents/grpc/src/proto/common.pb.h (8)

4-4: Update Protobuf C++ version stamp
Header comment updated to 6.31.1, aligning with the dependency bump.


15-19: Bump Protobuf runtime version check
PROTOBUF_VERSION macro updated to 6031001 to enforce compatibility.


98-99: Qualify std::move in Time move ctor
Move constructor now uses ::std::move, consistent with generated patterns.


301-302: Qualify std::move in ErrorInfo move ctor
Constructor initializer updated to ::std::move for namespace clarity.


509-510: Qualify std::move in CommonResponse move ctor
Initializer list now uses ::std::move, matching the other message types.


433-442: Fully qualify std::string in ErrorInfo accessors
All public and internal methods for the message field now use ::std::string.


905-914: Fully qualify std::string in CommonResponse::requestId accessors
Getter, mutable, release, and allocation methods explicitly use ::std::string.


970-979: Fully qualify std::string in CommonResponse::command accessors
Getter, mutable, release, and allocation methods explicitly use ::std::string.

agents/grpc/src/proto/profile.pb.h (2)

4-4: Version & Runtime Check Update
Updated the Protobuf C++ version comment to 6.31.1 and adjusted the PROTOBUF_VERSION check to require 6031001, matching the upgraded codegen.

Also applies to: 15-15


109-109: Qualified std::move in Move Constructors
Added the global namespace qualifier for std::move in the move constructors of all message classes, aligning with protobuf codegen conventions.

Also applies to: 300-300, 515-515, 717-717, 864-864

agents/grpc/src/proto/nsolid_service.pb.h (4)

4-4: Version & Runtime Check Update
Bumped Protobuf C++ version to 6.31.1 and updated the PROTOBUF_VERSION macro to 6031001 to enforce compatibility with the new runtime.

Also applies to: 15-15


101-101: Qualified std::move in Move Constructor
Prefixed the std::move call with :: in the EventResponse move constructor, following the updated code generation pattern.


230-235: Qualified std::string in API & Helper Declarations
Updated all std::string references in both public API and private helper method signatures to ::std::string, ensuring full namespace qualification.

Also applies to: 238-240


300-300: Qualified std::string in Method Definitions
All definitions for error_message getters/setters and related helpers now explicitly use ::std::string, matching the header declarations.

Also applies to: 312-312, 314-314, 318-318, 322-322, 327-327, 332-332, 345-345

agents/grpc/src/proto/packages.pb.h (3)

4-6: Version update to Protobuf 6.31.1 is correct.
The version string and PROTOBUF_VERSION check have been updated to 6.31.1 and 6031001 respectively, matching the PR’s objective of bumping the protobuf dependency.

Also applies to: 15-19


100-100: Explicit ::std::move qualification.
The move constructor now uses ::std::move, ensuring the standard library overload is selected unambiguously.


239-247: Consistent global namespace qualification for std::string.
All generated accessors and mutators for string fields (dependencies, path, name, version, main) now explicitly use ::std::string (and related STL types). This avoids ambiguity with custom types and aligns with the broader code-generation changes.

Also applies to: 256-262, 271-279, 285-293, 301-309, 1310-1316

deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/string_field.cc (3)

28-29: Insert port_def.inc.
Including google/protobuf/port_def.inc at the end of the include block ensures platform-specific macros are defined before this file’s content.


995-997: Insert port_undef.inc.
Including google/protobuf/port_undef.inc at the file’s end correctly undefines macros introduced by port_def.inc, preventing macro leakage.


220-221: Global namespace qualification for standard library symbols.
References to std::true_type, std::string, and forwarding utilities have been updated to ::std::true_type, ::std::string, and ::std::forward. This explicit qualification eliminates ambiguity and maintains consistency with the rest of the codebase.

Also applies to: 273-286, 837-842

deps/protobuf/src/google/protobuf/api.pb.h (6)

4-4: Protobuf version bump and runtime check updated
The generated header now specifies C++ gencode version 6.31.1 and checks PROTOBUF_VERSION != 6031001, matching the upgraded dependency.

Also applies to: 15-15


100-100: Explicit global ::std::move in move constructors
Move constructors in Mixin, Method, and Api now invoke ::std::move(...), ensuring they reference the standard library overload unambiguously.

Also applies to: 313-313, 598-598


229-256: Qualified std::string in Mixin class declarations
All Mixin accessor and mutator declarations now use ::std::string, eliminating any potential namespace ambiguity in the generated code.


900-1106: Qualified std::string in Api inline definitions
Inline methods for Api::name and Api::version now consistently use ::std::string in return types and parameters.


1297-1508: Qualified std::string in Method inline definitions
Inline getters and setters for Method::name, request_type_url, and response_type_url are now explicitly using ::std::string.


1614-1671: Qualified std::string in Mixin inline methods
The Mixin class’s inline field accessors (name and root) now uniformly use ::std::string for clarity and consistency.

deps/protobuf/src/google/protobuf/compiler/cpp/helpers.cc (3)

1183-1183: LGTM: Modern API usage.

Good modernization to use the direct is_repeated() method instead of label comparison, which is cleaner and more readable.


1215-1233: LGTM: Well-implemented string field detection.

The new HasRegularStringFields functions properly:

  • Use IsString() to identify string fields (excluding cord and string piece types as mentioned in the summary)
  • Recursively traverse nested types for comprehensive detection
  • Follow consistent patterns with other similar functions in the file

These functions support the conditional inclusion of string_view_migration.h mentioned in the AI summary.


1794-1810: LGTM: Correct field filtering logic.

The CollectFieldsExcludingWeakAndOneof function is well-implemented:

  • Properly filters out weak fields using IsWeak(field, options)
  • Correctly excludes oneof fields with !field->real_containing_oneof()
  • Returns the count of weak fields for layout optimization purposes
  • Uses appropriate iteration with FieldRange(d)

This supports the message layout optimization mentioned in the summary.

deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/enum_field.cc (3)

28-30: LGTM: Proper port macro inclusion.

Correctly includes port_def.inc at the beginning with the standard "Must be included last" comment, following protobuf patterns for platform-specific macro definitions.


494-495: LGTM: Consistent namespace qualification.

Good practice to explicitly use ::size_t instead of std::size_t to refer to the global namespace version, avoiding potential ambiguity. This change is consistent with the broader namespace qualification improvements mentioned in the summary.

Also applies to: 498-502, 552-552, 559-559, 561-561


583-584: LGTM: Proper port macro cleanup.

Correctly includes port_undef.inc at the end to bracket the implementation and clean up platform-specific macros, completing the proper macro management pattern.

agents/grpc/src/proto/command.pb.h (8)

4-4: Protobuf compiler version bump
Updated the generated header’s Protobuf C++ version comment to 6.31.1, matching the upgrade target.


15-19: Runtime version check updated
The PROTOBUF_VERSION macro is now 6031001 to enforce compatibility with the 6.31.1 runtime. This will cause a clear error if headers/runtime versions mismatch.


102-102: Qualified std::move
The move constructor uses ::std::move now, preventing any local macro or namespace collisions.


232-242: Qualified std::string in CommandResponse declarations
String accessors in CommandResponse have been updated to use ::std::string, ensuring consistent global‐namespace qualification.


1042-1087: Qualified std::string in CommandRequest.requestId
All requestId accessor and mutator definitions now fully qualify ::std::string, aligning with the new code‐generation style.


1107-1152: Qualified std::string in CommandRequest.id
The id field’s getters and setters consistently use ::std::string. Good consistency across generated methods.


1172-1217: Qualified std::string in CommandRequest.command
Accessor methods for the command field now fully qualify ::std::string, matching other updated patterns.


1363-1408: Qualified std::string in CommandResponse.message definitions
The implementations of message field methods are updated to use ::std::string. This aligns with the declaration changes above.

agents/grpc/src/proto/info.pb.h (4)

4-4: LGTM: Protobuf version update is consistent.

The protobuf version has been correctly updated from 6.30.2 to 6.31.1 with consistent changes to both the comment and runtime version check. The include header change from map_field_inl.h to map_field.h aligns with protobuf library evolution.

Also applies to: 15-15, 34-34


143-143: LGTM: Global namespace qualification for std::move improves safety.

The explicit ::std::move qualification ensures the standard library function is used regardless of any local namespace declarations that might shadow std. This is a good defensive practice for generated code.

Also applies to: 252-252, 579-579, 688-688


292-300: LGTM: Systematic namespace qualification for std::string types.

The explicit ::std::string qualification throughout method signatures, return types, and template parameters improves namespace safety. This prevents potential conflicts with user-defined string types and follows best practices for generated code that may be included in diverse namespace contexts.

Also applies to: 324-335, 533-533, 797-797, 809-842


1478-1479: LGTM: Global namespace qualification for std::forward enhances perfect forwarding safety.

The explicit ::std::forward qualification in template forwarding contexts prevents potential ADL issues and ensures the standard library's perfect forwarding utility is used consistently.

Also applies to: 1486-1486

deps/protobuf/src/google/protobuf/compiler/cpp/file.cc (1)

50-51: Include order caution

port.h must be included before any proto headers that rely on its portability macros.
You inserted it just before port_def.inc, which is correct.
Good catch.

deps/protobuf/src/google/protobuf/compiler/code_generator.h (1)

146-158: New helper API looks sound

GetResolvedSourceFeatureExtension() cleanly delegates to InternalFeatureHelper and keeps the template parameter list consistent with the existing helpers.
No issues spotted.

agents/grpc/src/proto/reconfigure.pb.h (2)

14-20: Generated version guard updated correctly

The runtime check now expects 6031001, matching protoc 6.31.1.
As long as the runtime library is upgraded in lock-step, this is fine.

Please ensure the build environment ships libprotobuf 6.31.1; otherwise this guard will hard-error.


241-254: Namespace qualification change is benign

Changing std::string to ::std::string reduces ADL surprises and matches modern protoc output.
Looks good.

agents/grpc/src/proto/nsolid_service.pb.cc (1)

4-4: LGTM! Protobuf version upgrade changes are consistent.

The systematic updates reflect the protobuf compiler upgrade from 6.30.2 to 6.31.1, including internal metadata optimizations, namespace qualification improvements, and weak linkage attributes. These are expected auto-generated changes with no functional impact.

Also applies to: 63-65, 72-72, 145-145, 240-241, 316-316, 391-391

deps/protobuf/src/google/protobuf/any.pb.cc (1)

4-4: LGTM! Core protobuf Any message updated consistently.

The changes to the protobuf Any message align with the version 6.31.1 upgrade, including proper namespace qualification (::std::) and internal metadata optimizations. The weak linkage attribute on GetClassData() follows the new compiler patterns.

Also applies to: 72-74, 83-83, 132-132, 230-231, 317-317, 327-327, 419-419

agents/grpc/src/proto/metrics.pb.cc (1)

4-4: LGTM! Multiple message types updated consistently.

Both MetricsBody and MetricsEvent messages show consistent protobuf 6.31.1 upgrade patterns, including bitmap/hasbit offset adjustments, migration schema simplifications, namespace qualifications, and weak attribute additions to GetClassData() methods.

Also applies to: 87-96, 100-101, 251-252, 389-389, 402-402, 514-515, 697-697

agents/grpc/src/proto/asset.pb.h (1)

4-4: LGTM! Header file API updates maintain compatibility.

The protobuf header shows appropriate version updates and systematic namespace qualification changes (std::::std::) for string types and move operations. The runtime version check ensures compatibility between generated code and runtime library.

Also applies to: 15-15, 93-93, 202-202, 229-241, 596-596, 608-608, 614-614, 618-618, 623-623, 628-628, 641-641

deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk.cc (4)

17-20: LGTM! Clean helper function with proper bounds checking.

The GetHasWordIdx function correctly calculates the 32-bit word index for hasbit tracking. The static_cast<size_t> ensures safe array indexing.


25-35: LGTM! Robust validation with helpful debug checks.

The function correctly validates that all fields share the same hasbit word index, with debug assertions to catch inconsistencies early. The empty check prevents undefined behavior.


57-71: LGTM! Correct bitmask generation with comprehensive validation.

The mask generation logic correctly:

  • Handles empty input gracefully
  • Validates consistent word indices across fields
  • Generates proper bit positions using modulo arithmetic
  • Ensures non-zero output with final assertion

75-88: LGTM! Well-designed overload for chunk iterator ranges.

The overloaded function appropriately:

  • Validates non-empty iterator range
  • Delegates consistency checking to helper function
  • Accumulates masks from multiple chunks using bitwise OR
  • Handles empty chunks gracefully in the loop
deps/protobuf/src/google/protobuf/compiler/cpp/helpers.h (5)

369-370: LGTM: Proper symbol export for IsRarelyPresent function.

Adding PROTOC_EXPORT ensures this function is properly exported from the protobuf compiler library, which is essential for external usage.


460-464: LGTM: Consistent export macros for ShouldSplit overloads.

Both overloads of ShouldSplit now have proper PROTOC_EXPORT macros, ensuring consistent symbol visibility across the API.


490-492: LGTM: New helper function for regular string field detection.

The HasRegularStringFields function provides a useful utility for checking string/bytes fields while excluding cord and string piece fields. The documentation clearly explains the exclusions.


499-499: LGTM: Corrected comment reference.

The comment correction from map_field_inl.h to map_field.h aligns with the actual header file that needs to be included for map field functionality.


735-741: LGTM: New utility function for field collection.

The CollectFieldsExcludingWeakAndOneof function provides a useful abstraction for gathering fields while excluding weak fields and oneof fields. The return of weak field count is a practical design for callers who need this information.

agents/grpc/src/proto/asset.pb.cc (7)

4-4: LGTM: Version update reflects protobuf upgrade.

The version update from 6.30.2 to 6.31.1 correctly reflects the protobuf dependency upgrade mentioned in the PR objectives.


70-72: LGTM: Internal metadata structure updates.

The changes to the offsets array (adding bitmap 0x081 and replacing ~0u with concrete hasbit index 11) are typical internal optimizations from the protobuf compiler upgrade. These affect layout optimization but don't change the public API.


93-93: LGTM: Simplified migration schema entry.

The migration schema simplification to only specify the size of the Asset struct is a reasonable optimization in the generated code.


136-136: LGTM: Namespace qualification improvement.

Using fully qualified ::std::declval instead of unqualified std::declval prevents potential namespace conflicts and is a good practice in generated code.


263-264: LGTM: Weak attribute and signature formatting.

Adding PROTOBUF_ATTRIBUTE_WEAK to GetClassData() allows for better link-time optimization, and splitting the signature across lines improves readability.


423-423: LGTM: Consistent namespace qualification.

Using fully qualified ::std::string prevents potential namespace conflicts in generated code, consistent with other similar changes in the file.


621-621: LGTM: Global namespace qualification for swap.

Using ::std::swap instead of std::swap ensures the standard library swap is used regardless of any potential local namespace declarations.

deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk_test.cc (5)

1-42: LGTM: Well-structured test infrastructure.

The helper functions CreateFieldArray and CreateAndCollectFields provide clean abstractions for test setup, making the tests more readable and maintainable. The use of templates allows for flexibility in testing different proto types.


43-85: LGTM: Comprehensive field collection tests.

The tests cover different chunking scenarios effectively:

  • SingleChunk: Tests when all fields group together
  • AllDifferentChunks: Tests when no fields group together
  • RepeatedAndSingular: Tests realistic grouping by field characteristics

The assertions properly validate both chunk count and field characteristics.


86-111: LGTM: Thorough chunk comparison tests.

The FindNextUnequalChunk tests validate both edge cases (all equal, all unequal) with appropriate predicates and verify that the returned iterator points to the correct chunk.


113-146: LGTM: Complete field extraction tests.

The extraction tests validate both negative case (extract none) and positive case (extract all), properly checking that:

  • Original chunks are modified (fields removed)
  • Extracted fields match the expected set
  • Empty chunks remain after extraction

148-178: LGTM: Accurate bit mask generation tests.

The bit mask generation tests validate:

  • Single field mask generation with correct bit position
  • Multiple chunk mask generation with OR-ed bits
  • Proper use of field indices and hasbit indices

The test assertions verify the exact bit patterns expected.

agents/grpc/src/proto/reconfigure.pb.cc (6)

4-4: Protobuf version upgrade applied correctly.

The version header has been properly updated to reflect the protobuf upgrade from 6.30.2 to 6.31.1.


104-106: Improved offset table efficiency.

The replacement of placeholder entries (~0u) with explicit bitmap and hasbit index offsets (0x081, 15, 5) improves runtime performance by reducing indirection in the internal protobuf metadata.

Also applies to: 130-133


142-143: Schema simplification improves efficiency.

The migration schema entries have been streamlined to include only essential data (start offset and size), reducing memory footprint and improving cache performance.


325-326: Added weak linking support for better library compatibility.

The PROTOBUF_ATTRIBUTE_WEAK attribute on GetClassData() methods enables weak linking, which helps avoid duplicate symbol issues when linking multiple protobuf-generated files and improves dynamic library compatibility.

Also applies to: 851-852


528-528: Improved namespace qualification for standard library types.

The change from std::string to ::std::string provides explicit global namespace qualification, preventing potential conflicts with user-defined types and ensuring unambiguous reference to the standard library.

Also applies to: 536-536, 544-544


714-714: Consistent global namespace qualification for swap function.

The change to using ::std::swap; maintains consistency with other namespace qualifications and ensures the standard library swap function is used, avoiding potential conflicts with user-defined swap functions.

Also applies to: 1034-1034

deps/protobuf/src/google/protobuf/compiler/code_generator_unittest.cc (3)

70-70: Properly exposed protected method for testing.

The using declaration appropriately exposes the protected GetResolvedSourceFeatureExtension method for unit testing, following standard testing patterns for accessing protected members.


250-385: Comprehensive test coverage for new feature extension functionality.

The new test methods provide excellent coverage of GetResolvedSourceFeatureExtension:

  • Basic functionality test: Verifies consistency with GetResolvedSourceFeatures().GetExtension()
  • Custom defaults test: Ensures proper behavior with modified feature set defaults
  • Edge case test: Validates behavior when pool doesn't provide defaults vs. when feature extensions do

The tests are well-structured with clear assertions and cover important scenarios for the new feature resolution functionality.


422-422: Updated test data reflects new protobuf features.

The addition of default_symbol_visibility field with appropriate values (EXPORT_ALL, EXPORT_TOP_LEVEL) in the test expectations correctly reflects the new feature support in the protobuf version upgrade.

Also applies to: 436-436, 449-452, 464-464

agents/grpc/src/proto/packages.pb.cc (4)

4-4: Consistent protobuf upgrade improvements applied.

The version update to 6.31.1 and offset table improvements with explicit bitmap values (0x081, 0x000) follow the same beneficial pattern seen in other protobuf-generated files, ensuring consistency across the codebase.

Also applies to: 125-127, 132-137


153-155: Schema optimization consistently applied.

The migration schema simplification mirrors the improvements in other protobuf files, reducing memory usage and improving performance across the entire generated codebase.


312-313: Weak linking support added consistently across all message classes.

The PROTOBUF_ATTRIBUTE_WEAK attribute has been properly added to all GetClassData() methods (PackagesEvent, PackagesBody, Package), ensuring consistent linking behavior across all protobuf-generated classes.

Also applies to: 615-616, 886-887


495-495: Global namespace qualification applied consistently.

The changes from std:: to ::std:: for swap functions and string types maintain consistency with other protobuf files and provide explicit global namespace qualification to prevent potential naming conflicts.

Also applies to: 753-753, 1011-1011, 1021-1021, 1031-1031, 1041-1041, 1207-1207

agents/grpc/src/proto/command.pb.cc (13)

4-4: LGTM! Protobuf version updated correctly.

The version header has been properly updated to reflect the new protobuf compiler version 6.31.1.


124-143: LGTM! Internal protobuf metadata optimizations.

The replacement of ~0u placeholders with explicit bitmap and hasbit index values improves the efficiency of the generated protobuf code. These are internal optimizations that don't affect the external API.


152-154: LGTM! Migration schema simplified appropriately.

The migration schema entries have been streamlined to include only the essential offset and size information, reducing memory overhead.


421-422: LGTM! Weak linking attribute added for optimization.

The PROTOBUF_ATTRIBUTE_WEAK attribute enables weak linking for better symbol management in the protobuf runtime.


748-749: LGTM! Weak linking attribute added consistently.

Consistent application of PROTOBUF_ATTRIBUTE_WEAK across all GetClassData() methods.


1126-1127: LGTM! Weak linking attribute applied consistently.

All message class GetClassData() methods now have the weak linking attribute for improved symbol management.


627-627: LGTM! Improved namespace qualification.

The explicit global namespace qualification (::std::swap) is more precise than relying on using declarations.


641-641: LGTM! Consistent namespace qualification.

Consistent use of global namespace qualification for standard library types.


858-878: LGTM! String reference types properly qualified.

The explicit global namespace qualification for ::std::string references in serialization methods improves code clarity and avoids potential namespace conflicts.


1010-1010: LGTM! Swap function properly qualified.

Consistent application of global namespace qualification for ::std::swap.


1029-1029: LGTM! HasBits type properly qualified.

Proper global namespace qualification for standard library types used in internal declarations.


1218-1218: LGTM! String reference properly qualified.

Consistent global namespace qualification for string references in CommandResponse serialization.


1308-1308: LGTM! Final swap function properly qualified.

Complete and consistent application of global namespace qualification throughout the file.

deps/protobuf/src/google/protobuf/compiler/cpp/padding_optimizer.h (3)

16-17: LGTM! Necessary includes added for refactored design.

The new includes for options.h and descriptor.h are required to support the constructor parameter and virtual method overrides.


29-33: LGTM! Well-designed inheritance-based refactoring.

The inheritance from MessageLayoutHelper promotes code reuse and the final declaration is appropriate for this concrete implementation. The explicit constructor properly initializes the base class with the required descriptor.


36-47: LGTM! Appropriate virtual method implementations.

The override methods provide sensible default behavior:

  • HasProfiledData() correctly indicates no profiling data
  • GetFieldHotness() assumes all fields are hot, which is reasonable for padding optimization
  • SingleFieldGroup() implements the basic field grouping strategy

These implementations align well with the padding optimization use case.

agents/grpc/src/proto/info.pb.cc (11)

4-4: Auto-generated version bump
The Protobuf C++ version comment has been updated to 6.31.1, aligning with the dependency upgrade.


135-187: Update internal offsets table for protobuf layout metadata
The explicit bitmap (0x081) and hasbit index offsets have been inserted for all message types, replacing placeholder entries. These changes are part of the internal protobuf layout optimization in v6.31.1.


189-194: Simplify MigrationSchema entries
The migration schema definitions now only include the start offset and size for each message type, removing redundant parameters. This matches the new code‐generation style.


286-291: Add PROTOBUF_ATTRIBUTE_WEAK to GetClassData() for map entry type
The GetClassData() method of InfoBody_VersionsEntry_DoNotUse is now marked PROTOBUF_ATTRIBUTE_WEAK to control symbol visibility.


497-502: Add PROTOBUF_ATTRIBUTE_WEAK to GetClassData() for InfoBody
The GetClassData() method of InfoBody is now weakly attributed, aligning it with other generated message types.


706-714: Qualify std::string with global namespace in serialization loops
All occurrences of std::string in the internal serialization code have been updated to ::std::string for explicit global namespace qualification.

Also applies to: 716-724, 734-742, 744-752, 754-762, 764-772, 774-782, 784-792, 803-811


338-342: Qualify std::declval with global namespace in internal type alias
The HasBits alias now uses ::std::declval to explicitly refer to the global namespace.


1166-1170: Use global ::std::swap in InternalSwap of InfoBody
The InternalSwap method now pulls in ::std::swap explicitly, avoiding ambiguity with any other swap overloads.


1196-1202: Qualify std::declval with global namespace in InfoEvent internal type alias
The HasBits alias for InfoEvent now uses ::std::declval, matching the change in InfoBody.


1311-1316: Add PROTOBUF_ATTRIBUTE_WEAK to GetClassData() for InfoEvent
InfoEvent::GetClassData() has been marked PROTOBUF_ATTRIBUTE_WEAK, consistent with other message types.


1493-1496: Use global ::std::swap in InternalSwap of InfoEvent
The InternalSwap implementation now explicitly uses ::std::swap to avoid potential ADL issues.

agents/grpc/src/proto/startup_times.pb.cc (7)

4-4: Auto-generated version bump
The Protobuf C++ version comment has been updated to 6.31.1, in line with the updated dependency.


77-94: Update internal offsets table for protobuf layout metadata
Explicit bitmap entries (0x081) and hasbit index offsets (5) have replaced previous placeholder values in the offsets array for both map entry and message types.


96-100: Simplify MigrationSchema entries
Migration schema definitions now list only the offset and size for each type, removing extra metadata parameters.


184-189: Add PROTOBUF_ATTRIBUTE_WEAK to GetClassData() for map entry type
The GetClassData() method on StartupTimesEvent_BodyEntry_DoNotUse gains the PROTOBUF_ATTRIBUTE_WEAK attribute for symbol visibility control.


235-242: Qualify std::declval with global namespace in internal type alias
The HasBits alias at StartupTimesEvent::_Internal now uses ::std::declval explicitly.


359-364: Add PROTOBUF_ATTRIBUTE_WEAK to GetClassData() for StartupTimesEvent
StartupTimesEvent::GetClassData() is now weakly attributed, consistent with other generated types.


556-562: Use global ::std::swap in InternalSwap of StartupTimesEvent
Internal swap logic now explicitly imports ::std::swap to ensure the intended overload is used.

agents/grpc/src/proto/source_code.pb.h (1)

14-19: Runtime / headers version guard will hard–fail the build if the runtime isn’t upgraded

#if PROTOBUF_VERSION != 6031001 means every translation-unit that includes this header now requires the 6.31.1 runtime headers and link-time runtime.
Make sure your build containers (and any downstream vendored copies) are bumped in lock-step, otherwise you’ll hit a hard compile error or, worse, an ABI mismatch at runtime.

agents/grpc/src/proto/common.pb.cc (2)

279-285: PROTOBUF_ATTRIBUTE_WEAK may break on MSVC / static builds

The new weak-symbol annotation on GetClassData() relies on tool-chain support for ELF weak linkage.
On Windows (MSVC / /MDd) this turns into a regular symbol which can yield duplicate-definition link errors when the header is included from multiple DLLs.
If you ship Windows builds, verify that:

  1. The compiler recognises __declspec(selectany) as the fallback emitted by protobuf.
  2. No duplicate symbol warnings appear when linking multiple .cc files that include generated headers.

993-1007: Namespace-qualified ::std::string is fine – just an FYI

The serializer now uses a fully-qualified ::std::string& _s, preventing accidental std hijacking via ADL.
No functional impact, good defensive change.

deps/protobuf/src/google/protobuf/compiler/cpp/extension.cc (1)

17-24: New Abseil / feature-resolver headers add link-time deps – update BUILD files

absl/status/statusor.h, absl/strings/*, and google/protobuf/feature_resolver.h pull in additional static libraries (absl_strings, absl_status, protobuf_feature_resolver, …).

Ensure:

  • deps/{BUILD,Makefile,package.json,…) lists the new libs.
  • CI images have them installed; otherwise you’ll see undefined-reference errors during link.
agents/grpc/src/proto/exit.pb.cc (12)

4-4: Protobuf compiler version update
The version banner has been updated to 6.31.1, matching the bump in the PR.


121-137: Update message hasbit metadata in offset table
The explicit bitmap entries and hasbit index offsets in TableStruct_exit_2eproto::offsets have been refreshed for the new schema layout.


148-150: Refresh migration schemas sizes
The schemas array entries have been adjusted to reflect the correct byte sizes for Error, ExitBody, and ExitEvent.


193-195: Fully qualify decltype for has_bits alias
The HasBits alias now uses ::std::declval, improving clarity and avoiding unqualified lookup.


292-297: Apply weak attribute to GetClassData
GetClassData() is now marked with PROTOBUF_ATTRIBUTE_WEAK for correct linkage semantics.


483-491: Namespace qualification for swap in InternalSwap
The InternalSwap method now explicitly uses using ::std::swap;, ensuring the global swap is selected.


498-503: Fully qualify decltype for has_bits alias in ExitBody
Consistent update of HasBits alias to ::std::declval, matching the other message classes.


608-613: Apply weak attribute to ExitBody::GetClassData
GetClassData() in ExitBody now carries PROTOBUF_ATTRIBUTE_WEAK as expected.


826-831: Namespace qualification for swap in ExitBody::InternalSwap
Swap invocation is now using using ::std::swap; for consistency.


846-852: Fully qualify decltype for has_bits alias in ExitEvent
Updated HasBits alias to use ::std::declval, aligning with other classes.


961-965: Apply weak attribute to ExitEvent::GetClassData
GetClassData() for ExitEvent is now correctly annotated with PROTOBUF_ATTRIBUTE_WEAK.


1143-1147: Namespace qualification for swap in ExitEvent::InternalSwap
The InternalSwap implementation now imports ::std::swap explicitly.

agents/grpc/src/proto/source_code.pb.cc (11)

4-4: Protobuf compiler version update
The version comment has been bumped to 6.31.1, consistent with the PR’s dependency update.


98-119: Update message hasbit metadata in offset table
The offsets for SourceCodeArgs and SourceCodeEvent now include explicit bitmap entries and updated hasbit index offsets.


122-126: Refresh migration schemas sizes
Migration schema entries have been updated to reflect the correct struct sizes for both message types.


167-171: Fully qualify decltype for has_bits alias in SourceCodeArgs
The HasBits alias now uses ::std::declval, improving namespace clarity.


276-281: Apply weak attribute to SourceCodeArgs::GetClassData
Added PROTOBUF_ATTRIBUTE_WEAK to GetClassData() for proper linkage.


386-392: Fully qualify std::string in SourceCodeArgs serialization
String references in _InternalSerialize are now explicitly const ::std::string&, removing any ambiguity.


488-493: Namespace qualification for swap in SourceCodeArgs::InternalSwap
using ::std::swap; has been added to ensure the correct swap is used.


509-515: Fully qualify decltype for has_bits alias in SourceCodeEvent
Consistent use of ::std::declval for the HasBits alias in SourceCodeEvent.


633-638: Apply weak attribute to SourceCodeEvent::GetClassData
GetClassData() is now marked with PROTOBUF_ATTRIBUTE_WEAK, matching other messages.


768-783: Fully qualify std::string in SourceCodeEvent serialization
Both path and code fields now use const ::std::string& in _InternalSerialize.


918-923: Namespace qualification for swap in SourceCodeEvent::InternalSwap
Explicit using ::std::swap; added to the swap implementation.

agents/grpc/src/proto/blocked_loop.pb.cc (7)

4-4: Version update correctly reflects the protobuf upgrade.

The protobuf compiler version comment has been properly updated to 6.31.1 as expected for this dependency upgrade.


179-227: Internal offset table optimizations are correctly applied.

The replacement of placeholder values (~0u) with explicit bitmap (0x081) and hasbit index offset values represents internal metadata improvements in the protobuf 6.31.1 code generator. These changes optimize field access patterns and are consistent across all message types.


236-240: Schema migration optimization correctly implemented.

The schema entries have been simplified to use starting offsets and message sizes, removing explicit field range indices. This internal optimization improves the efficiency of the generated protobuf code.


295-295: Namespace qualification improvements enhance code robustness.

The change from std::declval to ::std::declval provides full qualification of the standard namespace, which is a best practice in generated code to prevent potential namespace conflicts.


534-534: String reference namespace qualification correctly applied.

The change to const ::std::string& ensures full qualification of the standard string type, maintaining consistency with other namespace improvements.


712-712: Swap function namespace qualification is appropriate.

The change to using ::std::swap; provides explicit global namespace qualification for the swap function, which is important for generated code reliability.


406-407: GetClassData() method formatting and attributes improved.

The method signature has been split across two lines for better readability and marked with PROTOBUF_ATTRIBUTE_WEAK for proper symbol visibility control in the generated code.

deps/protobuf/src/google/protobuf/compiler/cpp/BUILD.bazel (7)

84-84: New field chunking source file properly added.

The addition of field_chunk.cc introduces new field chunking functionality for the C++ protobuf compiler, enhancing code generation optimization capabilities.


96-96: Message layout helper source file correctly included.

The addition of message_layout_helper.cc provides new message layout optimization functionality, replacing or enhancing the previous padding optimizer approach.


106-106: Field chunk header file properly declared.

The field_chunk.h header is correctly added to the hdrs section, making the field chunking functionality available to other components.


150-150: StatusOr dependency appropriately added.

The addition of @abseil-cpp//absl/status:statusor dependency enables proper error handling with StatusOr types in the new field chunking and message layout functionality.


162-167: Test proto files properly reorganized.

The splitting of test files into test_bad_identifiers_editions.proto and test_bad_identifiers_proto2.proto with the addition of cpp_features_proto dependency improves test coverage for different protobuf features and editions.


273-287: Field chunk test target properly configured.

The new field_chunk_test target is correctly structured with appropriate dependencies for testing the field chunking functionality, including necessary protobuf libraries, test frameworks, and Abseil components.


449-450: Test proto sources filegroup correctly updated.

The filegroup properly reflects the split of test proto files into separate editions and proto2 variants, maintaining consistency with the proto_library target changes.

agents/grpc/src/proto/profile.pb.cc (14)

4-4: Version bump to Protobuf C++ 6.31.1
This reflects the intended upgrade from 6.30.2 to 6.31.1 in the generated sources.


161-161: Generated offsets array update
This explicit bitmap value replaces the previous placeholder. No manual edits needed.


176-183: Replaced placeholder ~0u entries with explicit layout values
These changes are entirely in generated table metadata.


188-190: Updated bitmap and hasbit index for HeapProfileArgs/HeapSamplingArgs
Pure generated code adjustments.


264-264: Qualified std::declval with global namespace
Using ::std::declval is correct for full namespace qualification.


500-501: Added PROTOBUF_ATTRIBUTE_WEAK to GetClassData()
Marking GetClassData() as weak is consistent with the new compiler output.


831-831: Swapped in using ::std::swap; in InternalSwap
Qualifying swap in the global namespace improves ADL correctness.


913-914: Added PROTOBUF_ATTRIBUTE_WEAK to CPUProfileArgs GetClassData()
Consistent with other message types in this generation.


1047-1048: Added PROTOBUF_ATTRIBUTE_WEAK to HeapProfileArgs GetClassData()
Matches the new protoc-generated pattern.


1217-1217: Swapped in using ::std::swap; in HeapProfileArgs InternalSwap
Aligns with upstream namespace qualification.


1322-1323: Added PROTOBUF_ATTRIBUTE_WEAK to HeapSamplingArgs GetClassData()
Follows the standard generated annotations.


1525-1525: Swapped in using ::std::swap; in HeapSamplingArgs InternalSwap
Ensures proper ADL behavior.


1625-1626: Added PROTOBUF_ATTRIBUTE_WEAK to HeapSnapshotArgs GetClassData()
Consistent with other message implementations post-upgrade.


1764-1764: Swapped in using ::std::swap; in HeapSnapshotArgs InternalSwap
Matches the updated global swap qualification.

deps/protobuf/src/google/protobuf/any_lite.cc (6)

20-21: Include port_def.inc at top of file
Managing platform-specific macro definitions before pointer annotations.


52-54: Annotated InternalPackFromLite pointers for nullability
Adding PROTOBUF_NONNULL clarifies non-null contracts for dst_url and dst_value.


61-61: Annotated dst_message in InternalUnpackToLite as non-null
Improves static analysis guarantees.


72-74: Annotated ParseAnyTypeUrl parameters for nullability
url_prefix nullable and full_type_name non-null pointers are now explicit.


86-87: Overload ParseAnyTypeUrl annotated as non-null
Clarifies that full_type_name must not be null.


95-95: Include port_undef.inc at end of file
Restores platform macros after pointer annotations.

deps/protobuf/src/google/protobuf/any.cc (4)

26-27: Annotated InternalPackFrom pointers for nullability
dst_url and dst_value marked PROTOBUF_NONNULL to enforce non-null usage.


32-34: Second overload of InternalPackFrom annotated
Ensures dst_url and dst_value pointers are non-null across all overloads.


39-42: Annotated InternalUnpackTo destination message as non-null
Adding PROTOBUF_NONNULL to message parameter for clarity.


44-47: Annotated GetAnyFieldDescriptors pointers for nullability
type_url_field and value_field parameters now express their nullability contracts.

deps/protobuf/src/google/protobuf/api.pb.cc (5)

4-4: LGTM: Protobuf version upgrade reflected correctly.

The version comment update from 6.30.2 to 6.31.1 correctly reflects the protobuf dependency upgrade.


140-142: LGTM: Internal metadata structure updates.

The changes to bitmap and hasbit index offset values in the offsets table are part of the protobuf compiler's internal metadata optimization. These changes improve field layout efficiency without affecting the public API.

Also applies to: 157-159, 174-176


185-187: LGTM: Migration schema simplification.

The simplification of migration schema entries by removing redundant parameters and specifying only start offset and size improves code generation efficiency.


390-391: LGTM: Weak linkage attributes added.

The addition of PROTOBUF_ATTRIBUTE_WEAK to GetClassData() methods enables better symbol resolution across compilation units and aligns with protobuf's improved linking strategy.

Also applies to: 889-890, 1356-1357


245-245: LGTM: Global namespace qualifications added.

The systematic addition of global namespace qualifications (changing std:: to ::std::) improves code robustness by avoiding potential name lookup issues and ensures consistent symbol resolution.

Also applies to: 522-522, 554-554, 731-731, 757-757, 1020-1020, 1030-1030, 1049-1049, 1233-1233, 1258-1258, 1444-1444, 1454-1454, 1548-1548

deps/protobuf/src/google/protobuf/arena.cc (2)

125-128: LGTM: Nullability annotations improve static analysis.

The addition of PROTOBUF_NONNULL annotations to the ChunkList::AddFallback method parameters clarifies the non-null pointer contracts and enhances static analysis capabilities without changing functionality.


987-999: LGTM: Arena allocation methods properly annotated.

The PROTOBUF_NONNULL annotations on Arena's allocation methods (Allocate, AllocateForArray, AllocateAlignedWithCleanup) correctly document the non-null return value contracts and parameter expectations, improving code clarity and static analysis.

deps/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.h (4)

17-17: LGTM: Span header added for improved parameter passing.

The inclusion of absl/types/span.h supports the transition from vector parameters to span parameters for better efficiency.


35-36: LGTM: Improved parameter passing efficiency.

Changing from std::vector<int> to absl::Span<const int> for has_bit_indices and inlined_string_indices parameters eliminates unnecessary copies and provides a more flexible interface that accepts various container types.


41-46: LGTM: Well-designed static factory method.

The new BuildFieldOptions static method properly encapsulates the logic for constructing field options from message descriptors and related data. The method signature is well-designed with appropriate const-correctness and span parameters.


55-55: LGTM: Test access properly granted.

Adding TailCallTableInfoTest as a friend class enables proper unit testing of private members while maintaining encapsulation for production code.

deps/protobuf/src/google/protobuf/compiler/cpp/field_chunk.h (6)

1-12: LGTM: Proper header structure and includes.

The header guards, includes, and port_def.inc inclusion follow protobuf conventions correctly. The minimal set of includes avoids unnecessary dependencies.


19-30: LGTM: Well-designed FieldChunk structure.

The FieldChunk struct provides a clean abstraction for grouping fields with shared attributes. The boolean flags (has_hasbit, is_rarely_present, should_split) clearly represent field characteristics relevant to C++ code generation.


34-39: LGTM: Proper function declarations with export macros.

The GenChunkMask function overloads are properly declared with PROTOC_EXPORT for symbol visibility and take appropriate const-reference parameters to avoid unnecessary copies.


43-57: LGTM: Flexible template-based field collection.

The CollectFields template function provides a clean, predicate-based approach to partitioning fields into chunks. The use of equivalent predicate makes the function highly reusable for different chunking strategies.


59-69: LGTM: Efficient chunk iteration utility.

The FindNextUnequalChunk template function provides an efficient way to find the next chunk that differs from the current one, enabling optimized chunk processing algorithms.


73-91: LGTM: Useful field extraction with predicate filtering.

The ExtractFields template function efficiently extracts and removes fields matching a predicate from a range of chunks. The use of std::remove_if for in-place filtering is efficient and appropriate.

deps/protobuf/src/google/protobuf/compiler/cpp/message.h (3)

80-82: LGTM!

The updated comment clearly documents the behavioral change - GenerateOffsets now only returns the count of entries rather than handling bitmap-based offset emission internally. This simplification aligns with the refactored layout optimization approach.


204-209: Good use of template parameters with backward compatibility.

The addition of default template parameter kIsV2 = false maintains backward compatibility while allowing the code to differentiate between V1 and V2 byte size calculation paths. This is a clean approach to introducing new functionality.


78-78:

✅ Verification successful

Breaking change: Verify all callers of GenerateSchema have been updated.

The removal of the has_offset parameter from GenerateSchema is a breaking API change. This could cause compilation errors in any code that still passes this parameter.

Run the following script to verify all callers have been updated:


🏁 Script executed:

#!/bin/bash
# Description: Search for calls to GenerateSchema to ensure they match the new signature

# Search for calls to GenerateSchema method
ast-grep --pattern 'GenerateSchema($$$)' -l cpp cc

# Also search with ripgrep for more context
rg -A 3 -B 3 '->GenerateSchema\(' --type cpp
rg -A 3 -B 3 '\.GenerateSchema\(' --type cpp

Length of output: 601


The previous search didn’t actually scan any source files. Let’s rerun using ripgrep across all C++ sources:


🏁 Script executed:

#!/bin/bash
set -e

# Search for any calls to GenerateSchema in .cc, .cpp, and .h files
rg -n --glob '*.cc' --glob '*.cpp' --glob '*.h' 'GenerateSchema\s*\(' || true
rg -n --glob '*.cc' --glob '*.cpp' --glob '*.h' '->GenerateSchema\(' || true
rg -n --glob '*.cc' --glob '*.cpp' --glob '*.h' '\.GenerateSchema\(' || true

Length of output: 1011


GenerateSchema signature updated consistently – no internal callers remain using the old signature
I ran a full code-wide search across .h, .cc, and .cpp files and confirmed:

  • Declaration in deps/protobuf/src/google/protobuf/compiler/cpp/message.h:78 now uses GenerateSchema(io::Printer* p, int offset)
  • Definition in deps/protobuf/src/google/protobuf/compiler/cpp/message.cc:2344 matches the new signature
  • All internal calls (e.g. deps/protobuf/src/google/protobuf/compiler/cpp/file.cc:1187) have been updated accordingly

No remaining references to the old signature were found.

deps/protobuf/src/google/protobuf/arena_cleanup.h (3)

32-54: Good addition of nullability annotations for static analysis.

The addition of PROTOBUF_NONNULL annotations to the destructor function parameters and CleanupNode members helps catch potential null pointer dereferences at compile time. This improves code safety without runtime overhead.


62-86: Consistent nullability annotations throughout the API.

The non-null annotations on the Add, AddFallback, and AddFromExisting methods correctly document that these methods expect valid pointers. This helps prevent misuse of the API.


93-98: Appropriate use of nullable annotations for optional pointers.

The PROTOBUF_NULLABLE annotations on the member pointers correctly indicate that these can be null, particularly in the initial state. This is important documentation for maintainers.

deps/protobuf/src/file_lists.cmake (3)

1308-1308: Test infrastructure updates for better organization.

The replacement of map_test_util_impl.h with map_test_util.h and test_util.inc with test_util2.h suggests improvements in test organization. The cleaner naming is appreciated.

Also applies to: 1334-1334


1571-1572: Proto test files split for better separation of concerns.

Splitting test_bad_identifiers.proto into edition-specific and proto2-specific files (test_bad_identifiers_editions.proto and test_bad_identifiers_proto2.proto) provides better test isolation and clarity.


490-497: UPB generator file reorganization.

The addition of several UPB generator files (common.cc, file_layout.cc, minitable/fasttable.cc, etc.) with their corresponding headers indicates significant updates to the UPB code generation infrastructure.

Also applies to: 633-641

deps/protobuf/src/google/protobuf/any.pb.h (4)

4-4: LGTM! Version update is consistent.

The protobuf version update from 6.30.2 to 6.31.1 is properly reflected here.


15-19: LGTM! Version check macro properly updated.

The runtime version check is correctly updated to 6031001 matching the protobuf version 6.31.1.


90-90: LGTM! Consistent namespace qualification for std::move.

The change to use ::std::move is consistent with the pattern of explicit global namespace qualification used throughout this header.


279-290: LGTM! Consistent namespace qualification for std::string.

All occurrences of std::string have been systematically changed to ::std::string to use explicit global namespace qualification. This is a consistent pattern throughout the protobuf-generated code and helps avoid potential namespace conflicts.

Also applies to: 293-304, 365-475

deps/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.cc (8)

23-23: LGTM! Added necessary include for absl::Span.

The include for absl/types/span.h is properly added to support the refactoring from std::vector to absl::Span.


54-68: LGTM! Constructor properly refactored to use absl::Span.

The constructor now accepts absl::Span<const int> parameters and correctly copies the inlined_string_indices span into a vector member. This improves efficiency by avoiding unnecessary vector copies.


71-84: LGTM! Field options construction properly extracted.

The field options construction logic has been properly extracted into the static BuildFieldOptions method, improving code organization and testability. The initialization of tc_table_info_ is cleaner and more maintainable.


86-115: Well-structured static method for building field options.

The new BuildFieldOptions static method:

  • Properly uses absl::Span for efficient parameter passing
  • Maintains the same logic as before but in a more reusable form
  • Correctly reserves capacity before populating the vector
  • Handles all field option configurations consistently

140-141: LGTM! Function signatures updated to use absl::Span.

The MakeNumToEntryTable function declaration is properly updated to accept absl::Span<const FieldDescriptor* const>.


142-146: LGTM! FieldNameDataSize updated to use absl::Span.

The function properly uses absl::Span<const uint8_t> which is more flexible than vector and avoids unnecessary copies.


195-196: LGTM! MakeNumToEntryTable implementation updated.

The function implementation is correctly updated to match the declaration using absl::Span.


426-429:

❓ Verification inconclusive

Important: Verify compatibility with enum range consumers.

The field names in enum range auxiliary entries have been changed from start/size to first/last. This appears to be a breaking change in the generated code structure that could affect code consuming these auxiliary entries.

Run the following script to verify that all consumers of enum range auxiliary entries have been updated:


🏁 Script executed:

#!/bin/bash
# Description: Check for any remaining references to the old field names in enum range handling

# Search for references to enum_range.start or enum_range.size in the codebase
echo "Searching for old enum_range field references..."
rg -A 3 -B 3 'enum_range\.(start|size)' --type cpp

# Search for TailCallTableInfo::kEnumRange usage to ensure compatibility
echo -e "\nSearching for kEnumRange usage patterns..."
rg -A 5 -B 5 'kEnumRange' --type cpp

# Check the definition of enum_range struct to confirm the field rename
echo -e "\nChecking enum_range struct definition..."
ast-grep --pattern 'struct $_EnumRange {
  $$$
}'

Length of output: 30480


Would you please confirm the definition of the auxiliary‐entry struct and its enum_range member? Specifically, let’s verify the exact names of its fields and their types. For example, inspect AuxEntry in parse_function_generator.cc and the definition of the EnumRange type (and TailCallTableInfo if relevant):


🏁 Script executed:

#!/bin/bash
# Show AuxEntry definition
grep -R -n -C3 "struct AuxEntry" deps/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.cc

# Show enum_range declaration within AuxEntry
grep -R -n -C2 "enum_range" deps/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.cc

# Locate the EnumRange type definition
grep -R -n -C3 "EnumRange" deps/protobuf/src/google/protobuf/compiler

# Locate TailCallTableInfo definition for context
grep -R -n -C5 "struct TailCallTableInfo" deps/protobuf/src/google/protobuf/compiler/cpp

Length of output: 3488


I want to inspect the actual definitions of both AuxEntry and TailCallTableInfo (to see how enum_range is declared). Please run:


🏁 Script executed:

#!/bin/bash
# 1. Show where AuxEntry is defined in the generator
rg -n "AuxEntry" -C5 deps/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.cc

# 2. Find the header defining TailCallTableInfo
rg -l "class TailCallTableInfo" -tcpp deps/protobuf/src/google/protobuf/compiler | while read -r file; do
  echo "=== $file ==="
  rg -n -C5 "enum_range" "$file"
done

Length of output: 478


Could you please manually verify the actual definitions of the auxiliary‐entry and its enum_range member to ensure they’ve been renamed as expected? In particular:

  • Open deps/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.h
    – Locate struct AuxEntry and confirm that enum_range has fields named first and last (not start/size).
    – Locate TailCallTableInfo (in the same header or nearby) and confirm the enum case for kEnumRange maps to that enum_range member.

Once you’ve confirmed those definitions, you can be confident all consumers match the new first/last naming.

deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.cc (9)

1-31: LGTM! Well-structured includes and utility function.

The file has appropriate includes and a well-defined utility function EndsWithMsgPtr that checks if the last field is a non-repeated, non-lazy message pointer.


33-48: LGTM! FieldGroup methods are correctly implemented.

The FieldGroup class methods:

  • EstimateMemorySize() correctly sums up alignment sizes
  • Append() properly delegates to the update method
  • Comparison operator provides consistent ordering based on preferred location

49-64: Well-implemented field merging with weighted average calculation.

The UpdatePreferredLocationAndInsertOtherFields method correctly:

  • Handles empty field groups
  • Calculates weighted average for preferred location
  • Appends fields from the other group

The weighted average calculation ensures that field groups maintain a reasonable preferred location when merged.


66-76: LGTM! Clear optimization pipeline.

The DoOptimizeLayout method implements a clear three-stage optimization:

  1. Build alignment groups
  2. Merge groups to reduce padding
  3. Order fields for optimal layout

78-104: Well-designed field classification methods.

The classification methods provide a good foundation for layout optimization:

  • GetFieldFamily categorizes fields into logical groups
  • GetFieldHotnessCategory prioritizes fields by usage patterns
  • Proper handling of split fields and special cases

139-168: Excellent padding optimization through alignment consolidation.

The MergeFieldAlignmentGroups method implements a sophisticated approach to minimize padding:

  1. Groups 1-byte fields into 4-byte blocks
  2. Groups 4-byte blocks into 8-byte blocks
  3. Maintains field families and hotness categories throughout

This hierarchical grouping effectively reduces memory waste from padding.


170-240: Sophisticated field ordering with profile-driven optimization.

The BuildFieldDescriptorOrder method implements an advanced ordering strategy:

  • Uses profiled data when available for optimal hot path performance
  • Handles incomplete blocks intelligently to minimize padding
  • Switches between recipes based on field characteristics
  • Maintains stable ordering for consistency

The logic for placing incomplete 4-byte blocks is particularly clever, ensuring they pair up to form complete 8-byte blocks when possible.


242-273: Well-implemented field consolidation with proper bounds checking.

The ConsolidateAlignedFieldGroups method:

  • Correctly validates alignment relationships
  • Efficiently groups fields to reach target alignment
  • Uses stable sort to ensure consistent output
  • Properly reserves capacity for performance

195-202: 🛠️ Refactor suggestion

Add validation for incomplete block assumption.

The code assumes there's at most one incomplete 4-byte block and it's always the last element. This assumption should be validated more explicitly.

Add validation to ensure the assumption holds:

       auto it = absl::c_find_if(partition, [](const FieldGroup& fg) {
         return fg.EstimateMemorySize() <= 4;
       });
       if (it != partition.end()) {
         // There should be at most one incomplete 4-byte block, and it will
         // always be the last element.
         ABSL_CHECK(it + 1 == partition.end());
+        // Verify no other incomplete blocks exist
+        ABSL_CHECK(absl::c_count_if(partition, [](const FieldGroup& fg) {
+          return fg.EstimateMemorySize() <= 4;
+        }) == 1) << "Multiple incomplete 4-byte blocks found";

Likely an incorrect or invalid review comment.

deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_editions.proto (4)

44-44: Good test coverage for C++ string type features.

The proto effectively tests various C++ string types including STRING_PIECE, CORD, and VIEW, which is important for validating the code generator's handling of different string representations.

Also applies to: 70-70, 74-74, 124-124, 126-126


86-108: Comprehensive testing of integral type name conflicts.

Excellent coverage of potential naming conflicts with C++ integral types (uint8, int32_t, size_t, etc.). This ensures the code generator properly handles fields with names that match common C++ type names.


206-209: LGTM! Extension range with verification option.

The extension range declaration properly uses the edition syntax with verification = UNVERIFIED.


26-27:

✅ Verification successful

Verify the necessity of the generic services option.

The comment indicates this option was "auto-added" and references an internal Google link. Since this is for open-source protobuf, ensure this option is actually needed for the test cases.


🏁 Script executed:

#!/bin/bash
# Check if cc_generic_services is used elsewhere in the test files
rg "cc_generic_services" --type proto -A 2 -B 2

Length of output: 77


I’ll search across all .proto files without relying on an undefined file type:


🏁 Script executed:

#!/bin/bash
# Search for any occurrences of cc_generic_services in .proto files
rg "cc_generic_services" -n --glob '*.proto'

Length of output: 429


To confirm whether these tests define any services (and thus need the generic services option), let’s inspect their contents:


🏁 Script executed:

#!/bin/bash
# Print the first 80 lines to see service definitions and the cc_generic_services option
echo "=== test_bad_identifiers_proto2.proto ==="
sed -n '1,80p' deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_proto2.proto

echo
echo "=== test_bad_identifiers_editions.proto ==="
sed -n '1,80p' deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_editions.proto

Length of output: 4661


Checking for any service definitions in these test files:


🏁 Script executed:

#!/bin/bash
# Look for 'service' declarations in the two test files
rg "^\s*service " -n deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_proto2.proto deps/protobuf/src/google/protobuf/compiler/cpp/test_bad_identifiers_editions.proto

Length of output: 432


Option cc_generic_services Is Required

Both test_bad_identifiers_proto2.proto and test_bad_identifiers_editions.proto declare a service TestConflictingMethodNames, so the cc_generic_services = true option is necessary to enable generic-service codegen in these tests. No change needed.

deps/protobuf/src/google/protobuf/compiler/cpp/message_layout_helper.h (3)

30-69: Well-designed FieldGroup class with clear purpose.

The FieldGroup class provides a clean abstraction for grouping fields with similar characteristics. The EstimateMemorySize() method and its documentation clearly explain the memory layout optimization strategy.


139-146: Well-documented field family categories.

The FieldFamily enum provides clear categorization of fields based on their initialization and destruction patterns, which is crucial for optimizing memory layout and generated code performance.


158-164: Pure virtual methods provide good extensibility.

The pure virtual methods (HasProfiledData, GetFieldHotness, SingleFieldGroup) allow concrete implementations to customize the layout optimization based on profile data or other criteria.

deps/protobuf/src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc (4)

26-28: Proper inclusion of platform-specific headers.

Good practice to include port_def.inc and port_undef.inc to manage platform-specific macro definitions consistently across the codebase.


217-217: Consistent namespace qualification throughout.

Excellent work standardizing all namespace qualifications with ::std:: and ::absl:: prefixes. This prevents potential naming conflicts and improves code clarity.

Also applies to: 239-241, 302-302, 320-320, 325-325, 508-508, 562-563, 652-658, 662-663, 671-701, 705-706, 712-713, 723-724, 728-729, 734-735, 742-743, 747-748


673-678: Good use of conditional compilation for bytes fields.

The bytes_tag lambda elegantly handles the different treatment needed for BYTES vs STRING fields without duplicating code.


791-792: LGTM! Proper header guard management.

Correctly includes port_undef.inc at the end to clean up any macros defined by port_def.inc.

deps/protobuf/src/google/protobuf/any.h (2)

49-56: Adds explicit nullability contracts – good for static analysis

The introduction of PROTOBUF_NONNULL on dst_url, dst_value, and dst_message makes the expectations explicit and will help clang-tidy / MSVC SAL catch misuse at call-sites.
No issues spotted.


136-139: Double-pointer nullability annotation might be ambiguous

const FieldDescriptor* PROTOBUF_NULLABLE* PROTOBUF_NONNULL value_field mixes a non-null outer pointer with a potentially null inner pointer.
Some static-analysis tools interpret this combination differently (e.g. they treat it as “outer pointer is non-null, inner must be null”, instead of “may be null”).
Please confirm that the expansion in port_def.inc produces the intended attributes for all supported compilers (Clang ≥16, MSVC 17, GCC 12).

deps/protobuf/src/google/protobuf/BUILD.bazel (2)

552-566: micro_string introduces a third string implementation – check for ABI clashes

The new micro_string library brings its own small-string optimisation on top of absl::Cord/std::string.
Make sure:

  1. It is only linked into a single shared object to avoid ODR violations.
  2. Down-stream code does not accidentally mix micro_string with std::string APIs via implicit conversions.

If your Bazel build also produces a static libprotobuf.a, confirm that no duplicate symbols such as google::protobuf::internal::MicroString::kInlineSize are emitted.


674-681: protobuf_lite now depends on micro_string – verify transitive consumers

micro_string is added as an unconditional dependency. Any target that previously relied on the lean symbol surface of protobuf_lite will now pull this extra code in.

Consider adding a select() guard (e.g. //build_defs:enable_micro_string) if-and-when mobile or embedded targets want to stay on a minimal footprint.

deps/protobuf/src/google/protobuf/compiler/cpp/message.cc (1)

521-543: Possible logic gap when skipping empty chunks

is_same_hasword now treats chunks with fields.empty() as sharing the same has-word and the inner for loop breaks after pushing the first non-empty chunk mask.
If two or more consecutive empty chunks precede a non-empty one, the iterator advancement logic (for (; it != next; ++it)) will skip those empty chunks silently, but the outer while (it != end) later sets it = next – effectively moving past them twice.
The resulting pointer arithmetic is safe (it never crosses end), yet the second advance means at least one real chunk is never processed.

Double-check iteration intent and consider handling empty chunks explicitly before FindNextUnequalChunk().

deps/protobuf/src/google/protobuf/arena.h (9)

80-82: Consistent nullability for internal utilities

The arena_delete_object enforces a non-null object, while CanUseInternalSwap and CanMoveWithInternalSwap correctly accept nullable Arena* pointers and only return true when both arenas match.

Also applies to: 84-93, 95-104


125-126: Accurate nullability in ArenaOptions fields

In ArenaOptions, initial_block, block_alloc, and block_dealloc are properly marked as nullable, and the function-pointer return/parameter types remain non-null, matching the intended allocation/deallocation contracts.

Also applies to: 135-140


175-177: Nullable initial_block in Arena constructor

The overload Arena(char* PROTOBUF_NULLABLE initial_block, size_t) cleanly signals that initial_block may be null without changing runtime behavior.


199-200: Factory and destruction APIs nullability

Create, Destroy, and CreateArray now uniformly mark the arena parameter as nullable and ensure returned or passed-in object pointers are non-null, aligning with Protobuf’s allocation guarantees.

Also applies to: 233-234, 259-260


350-353: InternalHelper swap and retrieval annotations

InternalSwap enforces non-null objects, and GetArena accepts a non-null object while returning a nullable arena pointer. The annotations accurately reflect usage.

Also applies to: 354-356


401-403: Static SFINAE utilities nullability

The SFINAE helpers (DestructorSkippable, Construct, and New) now clearly annotate their parameters and return values for nullability, improving static analysis without affecting behavior.

Also applies to: 424-427, 429-431


495-497: Cleanup and compatibility methods nullability

ReturnArrayMemory and both CreateArenaCompatible overloads correctly annotate non-null object pointers and nullable arenas, matching the intended memory-management protocol.

Also applies to: 499-501, 515-516


529-532: Allocation routines enforce non-null results

All low-level allocation APIs (AllocateInternal, AllocateAlignedForArray, Allocate, AllocateForArray, and AllocateAlignedWithCleanup) now promise non-null returns, aligning with the existing inline macros and expectations.

Also applies to: 594-600, 608-612


645-651: Default/CopyConstruct and string specialization nullability

Out-of-line DefaultConstruct, CopyConstruct, and the std::string specialization for AllocateInternal correctly enforce non-null return pointers and non-null input parameters.

Also applies to: 654-656, 668-671

Comment on lines 344 to 351
if (field->is_repeated()) {
stats.repeated_total_pcount += analysis.presence_count;
if (analysis.element_stats.has_value()) {
stats.repeated_elem_stats = *analysis.element_stats;
}
} else {
stats.singular_total_pcount += analysis.presence_count;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Element-stats are overwritten, leading to double-counting

Here the struct’s repeated_elem_stats is assigned, while a few lines later it is added (+=).
The first assignment wipes any previous accumulation, so every repeated field is effectively counted twice (once by = and once by +=) and all prior fields are lost.

-      if (analysis.element_stats.has_value()) {
-        stats.repeated_elem_stats = *analysis.element_stats;
-      }
+      if (analysis.element_stats.has_value()) {
+        stats.repeated_elem_stats += *analysis.element_stats;
+      }

Also delete the later += to avoid a second accumulation:

-  if (field->is_repeated() && analysis.element_stats.has_value()) {
-    ABSL_LOG(INFO) << "Repeated field: " << field->full_name()
-                   << " has element stats: " << analysis.element_stats->mean;
-    stats.repeated_elem_stats += *analysis.element_stats;
-  }
+  if (field->is_repeated() && analysis.element_stats.has_value()) {
+    ABSL_LOG(INFO) << "Repeated field: " << field->full_name()
+                   << " has element stats: " << analysis.element_stats->mean;
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (field->is_repeated()) {
stats.repeated_total_pcount += analysis.presence_count;
if (analysis.element_stats.has_value()) {
stats.repeated_elem_stats = *analysis.element_stats;
}
} else {
stats.singular_total_pcount += analysis.presence_count;
}
if (field->is_repeated()) {
stats.repeated_total_pcount += analysis.presence_count;
if (analysis.element_stats.has_value()) {
stats.repeated_elem_stats += *analysis.element_stats;
}
} else {
stats.singular_total_pcount += analysis.presence_count;
}
Suggested change
if (field->is_repeated()) {
stats.repeated_total_pcount += analysis.presence_count;
if (analysis.element_stats.has_value()) {
stats.repeated_elem_stats = *analysis.element_stats;
}
} else {
stats.singular_total_pcount += analysis.presence_count;
}
if (field->is_repeated() && analysis.element_stats.has_value()) {
ABSL_LOG(INFO) << "Repeated field: " << field->full_name()
<< " has element stats: " << analysis.element_stats->mean;
}
🤖 Prompt for AI Agents
In deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc
around lines 344 to 351, the code assigns repeated_elem_stats with = which
overwrites previous values, and later adds to it with += causing
double-counting. To fix this, remove the assignment (=) and only accumulate
repeated_elem_stats using += to correctly sum stats without losing prior data or
double-counting.

Comment on lines +16 to +17
#include <unistd.h>

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Potential portability issue with POSIX-specific header.

The inclusion of unistd.h is POSIX-specific and may cause compilation issues on Windows platforms. Consider adding platform-specific conditional compilation if Windows support is required.


🏁 Script executed:

#!/bin/bash
# Description: Check if there are Windows-specific build configurations or CMake files that might indicate Windows support requirements

# Check for Windows-specific build files
fd -t f "CMakeLists.txt|BUILD|WORKSPACE|\.vcxproj|\.sln" | head -10

# Look for platform-specific code patterns
rg -i "windows|win32|_win|ifdef.*windows" --type cpp | head -10

Length of output: 1082


🏁 Script executed:

#!/bin/bash
# Locate the analyze_profile_proto_main.cc file and inspect its includes and unistd.h usage
file_path=$(fd -t f "analyze_profile_proto_main.cc" | head -n1)
echo "File path: $file_path"
# Show the first 50 lines for context
sed -n '1,50p' "$file_path"
echo
# Search the file for usages of unistd.h functions/macros
rg -n "unistd.h" -n "$file_path"
rg -n -e "getpid|getuid|getopt|sleep|unlink|access|isatty" "$file_path" || echo "No other unistd.h-specific calls found."

Length of output: 2795


Remove unused <unistd.h> include for portability

No POSIX functions from <unistd.h> are used in this file, and keeping it will break Windows builds. Please remove the include to restore cross-platform compatibility.

• File: deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto_main.cc:16

-#include <unistd.h>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#include <unistd.h>
🤖 Prompt for AI Agents
In
deps/protobuf/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto_main.cc
at line 16, the #include <unistd.h> directive is present but no POSIX-specific
functions from this header are used in the file. To improve portability and
avoid breaking Windows builds, remove the #include <unistd.h> line entirely
since it is unused and platform-specific.

Comment on lines +48 to +49
#include "google/protobuf/compiler/cpp/test_bad_identifiers_editions.pb.h"
#include "google/protobuf/compiler/cpp/test_bad_identifiers_proto2.pb.h"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the split test header files exist.

The replacement of a single test_bad_identifiers.pb.h with separate test_bad_identifiers_editions.pb.h and test_bad_identifiers_proto2.pb.h files aligns with protobuf's editions feature. This separation allows testing of both legacy proto2 and new editions syntax.


🏁 Script executed:

#!/bin/bash
# Description: Verify the new test header files exist in the protobuf source
# Expected: Both header files should be present

echo "Checking for test_bad_identifiers_editions.pb.h:"
fd "test_bad_identifiers_editions.pb.h" deps/protobuf/

echo "Checking for test_bad_identifiers_proto2.pb.h:"
fd "test_bad_identifiers_proto2.pb.h" deps/protobuf/

echo "Verifying old file is removed or still exists:"
fd "test_bad_identifiers.pb.h" deps/protobuf/

Length of output: 466


Missing split test header files

The includes for

#include "google/protobuf/compiler/cpp/test_bad_identifiers_editions.pb.h"
#include "google/protobuf/compiler/cpp/test_bad_identifiers_proto2.pb.h"

in deps/protobuf/src/google/protobuf/compiler/cpp/unittest.inc (lines 48–49) refer to files that are not present under deps/protobuf/. Neither the new headers nor the original test_bad_identifiers.pb.h were found in the tree.

Please ensure one of the following:

  • Commit or generate test_bad_identifiers_editions.pb.h and test_bad_identifiers_proto2.pb.h into the correct path.
  • If they live elsewhere, update the include paths accordingly.
  • Remove or replace these includes if the tests have been reorganized or the old header is no longer used.
🤖 Prompt for AI Agents
In deps/protobuf/src/google/protobuf/compiler/cpp/unittest.inc around lines 48
to 49, the included header files test_bad_identifiers_editions.pb.h and
test_bad_identifiers_proto2.pb.h are missing from the deps/protobuf/ directory.
To fix this, either add or generate these header files in the correct location,
update the include paths if the files exist elsewhere, or remove/replace these
includes if the tests have been moved or the headers are no longer needed.

Comment on lines +104 to +108
namespace {
bool ShouldGenerateFeatureSetDefaultData(absl::string_view extension) {
return extension == "pb.java" || extension == "pb.test";
}
} // namespace
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Name-match in ShouldGenerateFeatureSetDefaultData() looks fragile

return extension == "pb.java" || extension == "pb.test";

extension receives descriptor_->full_name(), which usually contains the package prefix
(e.g. "pb.pb.java" or "my.pkg.pb.java").
A strict equality check will fail in those cases, and the default-data block will never be emitted.

Consider comparing only the unqualified extension name, e.g.:

-return extension == "pb.java" || extension == "pb.test";
+return absl::EndsWith(extension, "pb.java") ||
+       absl::EndsWith(extension, "pb.test");
🤖 Prompt for AI Agents
In deps/protobuf/src/google/protobuf/compiler/cpp/extension.cc around lines 104
to 108, the function ShouldGenerateFeatureSetDefaultData uses a strict equality
check on the extension string, which includes package prefixes and causes
incorrect results. Modify the function to extract and compare only the
unqualified extension name (the suffix after the last dot) against "pb.java" and
"pb.test" to ensure correct matching regardless of package prefixes.

Comment on lines +211 to +217
void MaybeEmitUpdateCachedHasbits(const FieldDescriptor* field,
io::Printer* p,
int& cached_has_word_index) const;

void EmitUpdateByteSizeV2ForNumerics(
size_t field_size, io::Printer* p, int& cached_has_word_index,
std::vector<const FieldDescriptor*>&& fields) const;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Ensure proper test coverage for the new V2 helper methods.

The new helper methods MaybeEmitUpdateCachedHasbits and EmitUpdateByteSizeV2ForNumerics are specific to the V2 implementation. These need comprehensive testing to ensure correctness.

Run the following script to check for test coverage:


🏁 Script executed:

#!/bin/bash
# Description: Search for tests related to the new V2 methods

# Search for test files that might test these methods
rg -l "ByteSizeV2|MaybeEmitUpdateCachedHasbits|EmitUpdateByteSizeV2ForNumerics" --type cpp | grep -i test

# Look for V2-specific test cases
rg "TEST.*ByteSize.*V2" --type cpp

Length of output: 144


Add C++ unit tests for the new V2 helper methods

No existing tests reference MaybeEmitUpdateCachedHasbits or EmitUpdateByteSizeV2ForNumerics. Please add coverage in the C++ test suite, for example:

  • In google/protobuf/compiler/cpp/message_unittest.cc (or a new *_unittest.cc), write tests for:
    • MaybeEmitUpdateCachedHasbits verifying that has-bit words are updated correctly.
    • EmitUpdateByteSizeV2ForNumerics covering various numeric field sizes and combinations.
🤖 Prompt for AI Agents
In deps/protobuf/src/google/protobuf/compiler/cpp/message.h around lines 211 to
217, the new V2 helper methods MaybeEmitUpdateCachedHasbits and
EmitUpdateByteSizeV2ForNumerics lack unit test coverage. Add C++ unit tests for
these methods in google/protobuf/compiler/cpp/message_unittest.cc or a new
unittest file. Write tests that verify MaybeEmitUpdateCachedHasbits correctly
updates has-bit words and that EmitUpdateByteSizeV2ForNumerics handles various
numeric field sizes and combinations properly.

${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/cpp/enum.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/cpp/extension.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/cpp/field.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/cpp/field_chunk.cc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Message layout optimization refactoring looks good.

The replacement of padding_optimizer.cc with field_chunk.cc and message_layout_helper.cc indicates a significant refactoring of the layout optimization logic. The modular approach with separate field chunking and layout helper components is cleaner.

Also applies to: 379-379, 508-508, 515-515


🏁 Script executed:

#!/bin/bash
# Description: Verify the removal of padding_optimizer and its replacement

# Confirm padding_optimizer.cc is removed
fd padding_optimizer.cc

# Check if there are any remaining references to the old padding optimizer
rg -i "padding.?optimizer" --type cpp --type h | grep -v "padding_optimizer.h"

Length of output: 239


Remove leftover PaddingOptimizer reference in message.cc

A reference to the removed PaddingOptimizer class remains in message.cc, which will break the build. Please update it to use the new MessageLayoutHelper API.

• File: deps/protobuf/src/google/protobuf/compiler/cpp/message.cc

  • Replace the instantiation:
    - message_layout_helper_ = std::make_unique<PaddingOptimizer>(descriptor);
    + message_layout_helper_ = std::make_unique<MessageLayoutHelper>(descriptor);
  • Update the include at the top of the file:
    - #include "padding_optimizer.h"
    + #include "message_layout_helper.h"
🤖 Prompt for AI Agents
In deps/protobuf/src/google/protobuf/compiler/cpp/message.cc around the lines
referencing PaddingOptimizer, remove all references to the old PaddingOptimizer
class and replace them with the new MessageLayoutHelper API. Update the include
directives at the top of the file to remove padding_optimizer.h and add
message_layout_helper.h instead. Modify the instantiation and usage of the
layout optimizer to use MessageLayoutHelper methods and constructors accordingly
to ensure the build does not break.

${protobuf_SOURCE_DIR}/src/google/protobuf/generated_message_util.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/implicit_weak_message.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/inlined_string_field.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/internal_feature_helper.cc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

New internal feature helper added to core protobuf.

The addition of internal_feature_helper.cc to the core protobuf sources suggests new internal functionality for feature management. Ensure this is properly documented and tested.

Also applies to: 72-72


🏁 Script executed:

#!/bin/bash
# Description: Check the implementation and documentation of internal_feature_helper

# Look at the header file for API documentation
cat src/google/protobuf/internal_feature_helper.h | head -50

# Check if there are corresponding tests
fd -e cc -e cpp internal_feature_helper_test

Length of output: 187


🏁 Script executed:

#!/bin/bash
# Locate the header file for internal_feature_helper and show its first 50 lines
header_path=$(fd internal_feature_helper.h)
echo "Header found at: $header_path"
head -n 50 "$header_path"

# Search for any test files referencing internal_feature_helper
echo "Searching for tests..."
rg -n 'internal_feature_helper' --glob '*_test.*'

Length of output: 2345


Add Unit Tests for InternalFeatureHelper

The header already contains inline documentation, but I didn’t find any existing tests covering internal_feature_helper. Please add unit tests to validate its APIs and guard against regressions.

• deps/protobuf/src/google/protobuf/internal_feature_helper.h
– Documentation is present in the header.
• No test files reference InternalFeatureHelper (verified with rg 'internal_feature_helper' --glob '*_test.*').

Please add a new test (e.g., internal_feature_helper_test.cc) under your test suite to cover both public and friend-only methods.

🤖 Prompt for AI Agents
In deps/protobuf/src/file_lists.cmake at line 49, the new
internal_feature_helper.cc file has been added but there are no existing unit
tests for InternalFeatureHelper. To fix this, create a new test file named
internal_feature_helper_test.cc in the appropriate test directory. Write
comprehensive unit tests covering both the public API and any friend-only
methods of InternalFeatureHelper to ensure proper validation and prevent
regressions. Also verify that the tests are included in the build system.

Comment on lines +2595 to +2603
int num_generated_indices = 1;
const auto make_bitmap = [&](auto... bits) {
uint32_t res = 0;
int index = 0;
((res |= (static_cast<uint32_t>(bits) << index++)), ...);
((num_generated_indices += bits), ...);
return absl::StrCat("0x", absl::Hex(res, absl::kZeroPad3));
};

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Undefined evaluation order in make_bitmap lambda

The fold expression mutates and reads index (index++) inside the same
unsequenced expression
:

((res |= (static_cast<uint32_t>(bits) << index++)), ...);

The increment side-effect is unsequenced relative to other pack expansions
(pre-C++20) and results in undefined behaviour on most compilers.

Refactor to a simple loop:

-auto make_bitmap = [&](auto... bits) {
-  uint32_t res = 0;
-  int index = 0;
-  ((res |= (static_cast<uint32_t>(bits) << index++)), ...);
-  ((num_generated_indices += bits), ...);
-  return absl::StrCat("0x", absl::Hex(res, absl::kZeroPad3));
-};
+auto make_bitmap = [&](auto... bits) {
+  uint32_t res = 0;
+  int idx = 0;
+  for (bool b : {bits...}) {
+    if (b) res |= (1u << idx);
+    num_generated_indices += b;
+    ++idx;
+  }
+  return absl::StrCat("0x", absl::Hex(res, absl::kZeroPad3));
+};

This is well-defined and still constexpr-friendly.

🤖 Prompt for AI Agents
In deps/protobuf/src/google/protobuf/compiler/cpp/message.cc around lines 2595
to 2603, the fold expression in the make_bitmap lambda uses index++ inside an
unsequenced pack expansion, causing undefined behavior. Refactor the lambda to
replace the fold expression with a simple loop that iterates over the bits,
shifting and accumulating into res while incrementing index in a well-defined
sequence. This will ensure defined evaluation order and maintain
constexpr-friendliness.

Comment on lines +1332 to +1346
void MessageGenerator::MaybeEmitUpdateCachedHasbits(
const FieldDescriptor* field, io::Printer* p,
int& cached_has_word_index) const {
if (!HasHasbit(field) || field->options().weak()) return;

int has_bit_index = has_bit_indices_[field->index()];

if (cached_has_word_index == (has_bit_index / 32)) return;

cached_has_word_index = (has_bit_index / 32);
p->Emit({{"index", cached_has_word_index}},
R"cc(
cached_has_bits = this_.$has_bits$[$index$];
)cc");
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Cached has-bits update references generated symbol literally

this_.$has_bits$[$index$] is emitted verbatim; $has_bits$ is only defined
by surrounding WithVars(...) when a corresponding substitution is active.
If the caller forgets to wrap the emitter with HasBitVars, the placeholder
will leak into generated C++ and fail to compile.

Wrap the whole Emit in the same var-context used elsewhere or emit the
concrete member name (_impl_._has_bits_) directly.

🤖 Prompt for AI Agents
In deps/protobuf/src/google/protobuf/compiler/cpp/message.cc around lines 1332
to 1346, the code emits the string this_.$has_bits$[$index$] literally without
ensuring the $has_bits$ variable is defined, causing compilation errors if the
caller does not provide the substitution. To fix this, either wrap the Emit call
in the appropriate variable context that defines $has_bits$ (such as using
WithVars or HasBitVars) or replace the placeholder with the actual member name
like _impl_._has_bits_ directly in the emitted string to avoid relying on
external substitutions.

Comment on lines +1288 to 1297
template <bool kIsV2>
void MessageGenerator::EmitCheckAndUpdateByteSizeForField(
const FieldDescriptor* field, io::Printer* p) const {
absl::AnyInvocable<void()> emit_body = [&] {
field_generators_.get(field).GenerateByteSize(p);
const auto& gen = field_generators_.get(field);
if constexpr (!kIsV2) {
gen.GenerateByteSize(p);
} else {
}
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

GenerateByteSizeV2 path left unimplemented

Inside EmitCheckAndUpdateByteSizeForField<kIsV2> the else branch for the V2
calculation is empty (lines 1293-1296).
Any call executed with kIsV2 == true will therefore emit no byte-size logic,
silently under-counting the size and corrupting serialization.

-    } else {
-    }
+    } else {
+      gen.GenerateByteSizeV2(p);  // or appropriate V2 helper
+    }

Ensure a full implementation exists before enabling the V2 path.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
template <bool kIsV2>
void MessageGenerator::EmitCheckAndUpdateByteSizeForField(
const FieldDescriptor* field, io::Printer* p) const {
absl::AnyInvocable<void()> emit_body = [&] {
field_generators_.get(field).GenerateByteSize(p);
const auto& gen = field_generators_.get(field);
if constexpr (!kIsV2) {
gen.GenerateByteSize(p);
} else {
}
};
template <bool kIsV2>
void MessageGenerator::EmitCheckAndUpdateByteSizeForField(
const FieldDescriptor* field, io::Printer* p) const {
absl::AnyInvocable<void()> emit_body = [&] {
const auto& gen = field_generators_.get(field);
if constexpr (!kIsV2) {
gen.GenerateByteSize(p);
} else {
gen.GenerateByteSizeV2(p); // or appropriate V2 helper
}
};
🤖 Prompt for AI Agents
In deps/protobuf/src/google/protobuf/compiler/cpp/message.cc around lines 1288
to 1297, the else branch for the kIsV2 == true case in
EmitCheckAndUpdateByteSizeForField is empty, causing no byte-size calculation
for V2 and leading to serialization errors. Implement the V2 byte-size
calculation logic in this else branch, likely by calling the appropriate
GenerateByteSizeV2 method or equivalent on the field generator to correctly
compute the byte size when kIsV2 is true.

@santigimeno santigimeno force-pushed the santi/upgrade_protobuf branch from c820f89 to cf600b0 Compare July 18, 2025 13:38
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
deps/protobuf/.bazelci/README.md (1)

3-6: Replace bare URL & fix minor grammar for lint-compliance and clarity

markdownlint flags the naked URL, and the sentence has a small subject/verb agreement issue. Updating both improves readability and keeps CI green.

-The `.bazelci/presubmit.yml` file is used by https://buildkite.com/bazel/protobuf
-to test building protobuf with Bazel on Bazel CI. It should contain the same
-set of tests as `.bcr/presubmit.yml` which is the tests that will run before
-publishing protobuf to BCR.
+The `.bazelci/presubmit.yml` file is used by
+[Buildkite Bazel Protobuf CI](https://buildkite.com/bazel/protobuf)
+to test building protobuf with Bazel on Bazel CI. It should contain the same
+set of tests as `.bcr/presubmit.yml`, which are the tests that will run before
+publishing protobuf to the Bazel Central Registry (BCR).
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c820f89 and cf600b0.

⛔ Files ignored due to path filters (16)
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/logs/v1/logs_service.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/logs/v1/logs_service.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/metrics/v1/metrics_service.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/trace/v1/trace_service.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/collector/trace/v1/trace_service.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/common/v1/common.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/common/v1/common.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/logs/v1/logs.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/logs/v1/logs.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/metrics/v1/metrics.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/metrics/v1/metrics.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/resource/v1/resource.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/resource/v1/resource.pb.h is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/trace/v1/trace.pb.cc is excluded by !**/gen/**
  • deps/opentelemetry-cpp/third_party/opentelemetry-proto/gen/cpp/opentelemetry/proto/trace/v1/trace.pb.h is excluded by !**/gen/**
📒 Files selected for processing (37)
  • agents/grpc/src/proto/asset.pb.cc (7 hunks)
  • agents/grpc/src/proto/asset.pb.h (7 hunks)
  • agents/grpc/src/proto/blocked_loop.pb.cc (23 hunks)
  • agents/grpc/src/proto/blocked_loop.pb.h (14 hunks)
  • agents/grpc/src/proto/command.pb.cc (16 hunks)
  • agents/grpc/src/proto/command.pb.h (19 hunks)
  • agents/grpc/src/proto/common.pb.cc (15 hunks)
  • agents/grpc/src/proto/common.pb.h (16 hunks)
  • agents/grpc/src/proto/exit.pb.cc (15 hunks)
  • agents/grpc/src/proto/exit.pb.h (16 hunks)
  • agents/grpc/src/proto/info.pb.cc (20 hunks)
  • agents/grpc/src/proto/info.pb.h (36 hunks)
  • agents/grpc/src/proto/metrics.pb.cc (8 hunks)
  • agents/grpc/src/proto/metrics.pb.h (4 hunks)
  • agents/grpc/src/proto/nsolid_service.pb.cc (6 hunks)
  • agents/grpc/src/proto/nsolid_service.pb.h (7 hunks)
  • agents/grpc/src/proto/packages.pb.cc (15 hunks)
  • agents/grpc/src/proto/packages.pb.h (20 hunks)
  • agents/grpc/src/proto/profile.pb.cc (16 hunks)
  • agents/grpc/src/proto/profile.pb.h (7 hunks)
  • agents/grpc/src/proto/reconfigure.pb.cc (11 hunks)
  • agents/grpc/src/proto/reconfigure.pb.h (16 hunks)
  • agents/grpc/src/proto/source_code.pb.cc (12 hunks)
  • agents/grpc/src/proto/source_code.pb.h (15 hunks)
  • agents/grpc/src/proto/startup_times.pb.cc (7 hunks)
  • agents/grpc/src/proto/startup_times.pb.h (4 hunks)
  • deps/protobuf/.bazelci/README.md (1 hunks)
  • deps/protobuf/.bazelci/presubmit.yml (1 hunks)
  • deps/protobuf/.bazelrc (1 hunks)
  • deps/protobuf/.bcr/metadata.template.json (0 hunks)
  • deps/protobuf/.bcr/presubmit.yml (2 hunks)
  • deps/protobuf/protobuf.gyp (2 hunks)
  • deps/protobuf/src/file_lists.cmake (26 hunks)
  • deps/protobuf/src/google/protobuf/BUILD.bazel (24 hunks)
  • deps/protobuf/src/google/protobuf/any.cc (1 hunks)
  • deps/protobuf/src/google/protobuf/any.h (3 hunks)
  • deps/protobuf/src/google/protobuf/any.pb.cc (8 hunks)
💤 Files with no reviewable changes (1)
  • deps/protobuf/.bcr/metadata.template.json
✅ Files skipped from review due to trivial changes (9)
  • deps/protobuf/.bazelrc
  • deps/protobuf/.bazelci/presubmit.yml
  • agents/grpc/src/proto/startup_times.pb.h
  • agents/grpc/src/proto/nsolid_service.pb.h
  • agents/grpc/src/proto/blocked_loop.pb.h
  • agents/grpc/src/proto/exit.pb.h
  • agents/grpc/src/proto/metrics.pb.cc
  • agents/grpc/src/proto/common.pb.cc
  • agents/grpc/src/proto/blocked_loop.pb.cc
🚧 Files skipped from review as they are similar to previous changes (25)
  • deps/protobuf/protobuf.gyp
  • deps/protobuf/.bcr/presubmit.yml
  • agents/grpc/src/proto/asset.pb.h
  • agents/grpc/src/proto/common.pb.h
  • agents/grpc/src/proto/profile.pb.h
  • agents/grpc/src/proto/packages.pb.h
  • agents/grpc/src/proto/nsolid_service.pb.cc
  • agents/grpc/src/proto/info.pb.h
  • agents/grpc/src/proto/metrics.pb.h
  • deps/protobuf/src/google/protobuf/any.pb.cc
  • agents/grpc/src/proto/asset.pb.cc
  • agents/grpc/src/proto/reconfigure.pb.h
  • agents/grpc/src/proto/packages.pb.cc
  • agents/grpc/src/proto/info.pb.cc
  • agents/grpc/src/proto/startup_times.pb.cc
  • agents/grpc/src/proto/source_code.pb.cc
  • agents/grpc/src/proto/reconfigure.pb.cc
  • agents/grpc/src/proto/profile.pb.cc
  • agents/grpc/src/proto/command.pb.cc
  • deps/protobuf/src/google/protobuf/any.cc
  • agents/grpc/src/proto/exit.pb.cc
  • agents/grpc/src/proto/source_code.pb.h
  • agents/grpc/src/proto/command.pb.h
  • deps/protobuf/src/file_lists.cmake
  • deps/protobuf/src/google/protobuf/any.h
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
deps/protobuf/.bazelci/README.md

3-3: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: test-macOS
  • GitHub Check: test-linux (ubuntu-24.04)
  • GitHub Check: test-linux (ubuntu-24.04-arm)
  • GitHub Check: lint-js-and-md
  • GitHub Check: build-tarball
  • GitHub Check: coverage-windows
🔇 Additional comments (13)
deps/protobuf/src/google/protobuf/BUILD.bazel (13)

34-37: LGTM: Consistent UPB target additions.

The addition of upb_c_proto_library and upb_proto_reflection_library targets for all well-known types follows a consistent pattern and properly depends on the corresponding proto libraries. This aligns with the protobuf 31.1 update introducing expanded UPB support.

Also applies to: 39-42, 59-62, 64-67, 80-83, 85-88, 101-104, 106-109, 133-136, 138-141, 154-157, 159-162, 175-178, 180-183, 200-203, 205-208, 221-224, 226-229


552-565: LGTM: Well-structured micro_string library addition.

The new micro_string library and its corresponding test are properly structured with appropriate dependencies. The library depends on arena components and the test includes necessary testing dependencies.

Also applies to: 567-583


680-680: LGTM: Appropriate micro_string dependency additions.

The addition of micro_string as a dependency to both protobuf_lite and protobuf targets is correct and necessary for the new string handling functionality.

Also applies to: 777-777


721-721: LGTM: Proper internal_feature_helper integration.

The addition of internal_feature_helper.h to the headers list and internal_feature_helper.cc to the protobuf target sources is correctly structured for the new internal feature helper component.

Also applies to: 758-758


807-807: LGTM: Appropriate charset dependency addition.

The addition of @abseil-cpp//absl/strings:charset dependency is reasonable for enhanced string processing capabilities in protobuf 31.1.


1347-1347: LGTM: Appropriate test utility header addition.

The addition of map_test_util.h to the lite_test_util target is correctly placed for map-related testing functionality.


1415-1415: LGTM: Improved test_util2 dependency structure.

The addition of :test_util as a dependency to the test_util2 target establishes a proper dependency relationship, which is better than the previous textual headers approach.


1573-1595: LGTM: Well-structured lazily_build_dependencies_test addition.

The new lazily_build_dependencies_test target is properly structured with comprehensive dependencies that are appropriate for testing lazy dependency building functionality. The configuration is consistent with other test targets.


1638-1639: LGTM: Necessary test dependency additions.

The addition of dependencies to various test targets is appropriate for the updated functionality:

  • cpp_features_cc_proto and port for dynamic_message_unittest
  • lite_test_util for generated_message_reflection_unittest
  • cc_lite_test_protos for lite_arena_unittest
  • port for unknown_field_set_unittest

These additions ensure tests have access to the required components.

Also applies to: 1645-1646, 1752-1752, 1822-1822, 2217-2217


1709-1738: LGTM: Comprehensive internal_feature_helper_test addition.

The new internal_feature_helper_test target is well-structured with appropriate dependencies for testing the internal feature helper functionality. The configuration is consistent with other test targets in the file.


1413-1413: LGTM: Appropriate test exclusion.

The exclusion of lazily_build_dependencies_test.cc from the full_test_srcs filegroup is consistent with other specialized tests that are excluded from the general test suite.


1421-1425: LGTM: Organized test source filegroup addition.

The new lazily_build_dependencies_test_srcs filegroup provides proper organization for the specialized test source file, consistent with the pattern used for other specialized test sources.


1-2449: LGTM: Comprehensive and well-structured protobuf 31.1 update.

The changes in this BUILD.bazel file are consistent with the protobuf 31.1 update and include:

  1. New UPB targets: Added upb_c_proto_library and upb_proto_reflection_library targets for all well-known types
  2. New micro_string library: Added with proper dependencies and test coverage
  3. New internal_feature_helper: Added to headers and sources with corresponding test
  4. Updated dependencies: Added necessary dependencies to existing targets
  5. New test targets: Added comprehensive test coverage for new functionality
  6. Proper organization: New filegroups and exclusions maintain clean structure

All changes follow established patterns and maintain consistency with the existing codebase structure. The dependency relationships are appropriate and the new functionality is properly tested.

@santigimeno santigimeno force-pushed the santi/upgrade_protobuf branch from cf600b0 to c951f2c Compare July 18, 2025 15:04
santigimeno added a commit that referenced this pull request Jul 18, 2025
PR-URL: #325
Reviewed-By: Rafael Gonzaga <[email protected]>
@santigimeno
Copy link
Member Author

Landed in 3a53c65

@santigimeno santigimeno deleted the santi/upgrade_protobuf branch July 18, 2025 15:09
santigimeno added a commit that referenced this pull request Jul 23, 2025
PR-URL: #325
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Aug 25, 2025
PR-URL: #325
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Aug 26, 2025
PR-URL: #325
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #359
Reviewed-By: Juan José Arboleda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants