Skip to content

Refactor(index): remove unused keys, 0-based depth, and add CI workflows#149

Merged
wenchy merged 32 commits into
masterfrom
remove-unused-keys-from-index-processing
Mar 12, 2026
Merged

Refactor(index): remove unused keys, 0-based depth, and add CI workflows#149
wenchy merged 32 commits into
masterfrom
remove-unused-keys-from-index-processing

Conversation

@Kybxd

@Kybxd Kybxd commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

Refactor the index/ordered-index processing pipeline to remove unused map keys, switch to 0-based depth semantics, and streamline key collection logic across both Go and C++ code generators. Additionally, add comprehensive CI testing workflows for Go and C++ on Ubuntu and Windows.

// is needed by any subsequent regular index's leveled containers.
func (x *Generator) needMapKeyForIndex(mapDepth int) bool {
for levelMessage := x.descriptor.LevelMessage; levelMessage != nil; levelMessage = levelMessage.NextLevel {
if len(levelMessage.Indexes) > 0 && levelMessage.MapDepth-2 >= mapDepth {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please give comment to describe the magic number 2 in levelMessage.MapDepth-2

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

a new function NumLeveledContainers is added

Comment thread internal/index/descriptor.go Outdated
Comment on lines +67 to +69
func (l *LevelMessage) NumLeveledContainers() int {
return l.MapDepth - 2
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NumLeveledContainers -> UpperContainers ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ai generated function name

Kybxd added 4 commits March 11, 2026 14:19
- Implemented the Fruit5Conf message structure with a 3-level map (fruit_map -> country_map -> item_map).
- Added indexing functionality for the country level, allowing retrieval of countries by name.
- Updated generator logic to handle the new Fruit5Conf structure without generating extra LevelIndex key structs.
- Enhanced tests to validate the behavior of the new Fruit5Conf, ensuring correct index generation and retrieval.
- Updated Go and C++ loader implementations to support the new Fruit5Conf message.
- Added a minimal JSON configuration file for Fruit5Conf.
@Kybxd
Kybxd requested a review from wenchy March 11, 2026 08:54
Kybxd and others added 21 commits March 11, 2026 17:28
- Remove shell: bash from Init/Generate steps to use default cmd on Windows
- Add working-directory to CMake Configure step
- Fix gen_script paths relative to working-directory
- Fix testing-cpp.yml: skip CMake setup action on Linux, install cmake via apt instead
- Improve cpp-tableau-loader gen.sh and gen.bat scripts
- Update go-tableau-loader gen.sh and gen.bat scripts
- Update CMakeLists.txt and init.bat
- Simplified the initialization of LevelMessage and IndexDescriptor in tests.
- Removed redundant depth and map depth assignments for clarity.
- Consolidated index definitions to reduce repetition and enhance maintainability.
- Updated test assertions to reflect the new structure and ensure accuracy.
- Removed obsolete test for map keys collection as it is no longer relevant.
wenchy added 4 commits March 12, 2026 23:08
…latform protobuf linking

Key changes:
- Use find_package(Protobuf CONFIG REQUIRED) instead of MODULE mode to correctly
  pick up protobuf's own config files from the local build directory.
- Disable ZLIB dependency (-Dprotobuf_WITH_ZLIB=OFF) in protobuf build to avoid
  ZLIB::ZLIB link requirement in exported CMake targets.
- Explicitly set -Dprotobuf_BUILD_SHARED_LIBS=OFF for clarity.
- Use Ninja generator and Debug build type consistently on both Ubuntu and Windows.
- protobuf::libprotobuf imported target auto-provides include dirs, so removed
  manual Protobuf_INCLUDE_DIRS from include_directories().
- Static CRT (/MTd) on MSVC matches protobuf's default static runtime.
@wenchy wenchy changed the title fix(codegen): only declare map key variables when actually used in index/ordered-index processing Refactor(index): remove unused keys, 0-based depth, and add CI workflows Mar 12, 2026
@wenchy
wenchy merged commit d7d9882 into master Mar 12, 2026
4 checks passed
@wenchy
wenchy deleted the remove-unused-keys-from-index-processing branch March 12, 2026 15:57
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.

2 participants