Skip to content

Free up EDGE_TYPE=-5 for EDGE_GROUP_TYPE - #393

Merged
zipdoki merged 2 commits into
mainfrom
fix/rename-immutable-indexed-edge-type
Jul 8, 2026
Merged

zipdoki merged 2 commits into
mainfrom
fix/rename-immutable-indexed-edge-type

Conversation

@eazyhozy

@eazyhozy eazyhozy commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Splits off the -5 rename tweak from #389, per @zipdoki's review comment.

EncodedEdgeType.IMMUTABLE_INDEXED_EDGE_TYPE occupied -5 but was never wired to any live encoder/decoder path. Renaming it in place to EDGE_GROUP_TYPE would have implied -5 had always meant EDGE_GROUP, which isn't historically true. Instead:

  • Move IMMUTABLE_INDEXED_EDGE_TYPE to an unused code (-100).
  • Add EDGE_GROUP_TYPE(-5) as a new entry, matching core's EdgeRecordType.EDGE_GROUP(-5).
  • Clean up the dead -5 references in AbstractEdgeEncoder / DecodedEdge.

No behavior change.

Ref #389

Changes

  • EncodedEdgeType.java: move IMMUTABLE_INDEXED_EDGE_TYPE to -100, add EDGE_GROUP_TYPE(-5).
  • AbstractEdgeEncoder.java: drop the dead IMMUTABLE_INDEXED_EDGE_TYPE constant (no callers referenced it).
  • DecodedEdge.java: drop the dead IMMUTABLE_INDEXED_EDGE_TYPE decode branches (L98-99, L164).
    • This type code was never actually produced on the wire — BulkEdgeEncoder encodes LabelType.IMMUTABLE_INDEXED labels using the INDEXED_EDGE_TYPE tag, not IMMUTABLE_INDEXED_EDGE_TYPE, so no encoded byte stream ever carried this type code and the branch was unreachable.
    • Since IMMUTABLE_INDEXED_EDGE_TYPE is being moved off -5 anyway, leaving the branch in place (just comparing against -100 instead) would keep dead code around under a new code point rather than actually cleaning it up as the review comment asked.
    • Verified via grep -rn "IMMUTABLE_INDEXED_EDGE_TYPE" across codec-java: the only references were this decode branch and the unused AbstractEdgeEncoder constant.

How to Test

./gradlew :codec-java:test

All existing tests pass; no behavior change.

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: Claude Code (Sonnet 5)

IMMUTABLE_INDEXED_EDGE_TYPE occupied -5, colliding with the online
EdgeRecordType.EDGE_GROUP(-5). Move it to an unused code (-100) and
add EDGE_GROUP_TYPE(-5) as a new entry, matching core. Also drop the
dead IMMUTABLE_INDEXED_EDGE_TYPE constant/branches that had no live
callers.

No behavior change.
@eazyhozy eazyhozy self-assigned this Jul 7, 2026
@eazyhozy
eazyhozy requested a review from zipdoki July 7, 2026 02:29
@eazyhozy
eazyhozy marked this pull request as ready for review July 7, 2026 02:30
@eazyhozy
eazyhozy requested a review from em3s as a code owner July 7, 2026 02:30
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. maintenance Maintenance work. labels Jul 7, 2026
@eazyhozy eazyhozy changed the title refactor(codec-java): free up -5 for EDGE_GROUP_TYPE Free up EDGE_TYPE=-5 for EDGE_GROUP_TYPE Jul 7, 2026

@zipdoki zipdoki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 7, 2026
@eazyhozy

eazyhozy commented Jul 8, 2026 •

Copy link
Copy Markdown
Member Author

Offline review feedback from @em3s:

Since IMMUTABLE_INDEXED_EDGE_TYPE is being removed from the branching logic anyway, it's an enum entry that doesn't seem likely to be used again — better to just remove it entirely.

Agreed — will remove IMMUTABLE_INDEXED_EDGE_TYPE entirely instead of moving it to -100.

Per review feedback on #393: since IMMUTABLE_INDEXED_EDGE_TYPE was
already being dropped from all branching logic, moving it to an
unused code (-100) just kept dead code around under a new code
point. Remove the enum entry entirely instead.

No behavior change — this entry had no remaining references.
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 8, 2026
@zipdoki

zipdoki commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Optimistic Merge

@zipdoki
zipdoki merged commit 2e5440f into main Jul 8, 2026
2 checks passed
@zipdoki
zipdoki deleted the fix/rename-immutable-indexed-edge-type branch July 8, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer maintenance Maintenance work. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants