Generate KnownTags from tag-conventions via the tag-registry code generator (phase 2)#12047
Draft
dougqh wants to merge 1 commit into
Draft
Generate KnownTags from tag-conventions via the tag-registry code generator (phase 2)#12047dougqh wants to merge 1 commit into
dougqh wants to merge 1 commit into
Conversation
This was referenced Jul 23, 2026
Bits has a CI fix ready🟢 Investigated · 🟢 Fix prepared · ⚪ Validation skipped · 🟠 Ready
View in Datadog | Reviewed commit e6800b8 · Any feedback? Reach out in #deveng-pr-agent |
|
🎯 Code Coverage (details) 🔗 Commit SHA: e6800b8 | Docs | Datadog PR Page | Give us feedback! |
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
dougqh
commented
Jul 23, 2026
dougqh
commented
Jul 23, 2026
dougqh
commented
Jul 23, 2026
dougqh
force-pushed
the
dougqh/generator-v2
branch
from
July 23, 2026 02:34
79bc101 to
7f3d0b1
Compare
…erator Replaces the hand-maintained known-tag table with one emitted from a single source of truth, so tag ids / resolver / (later) per-type layouts stop drifting across core, instrumentation, and language tracers. Generator (buildSrc, à la SupportedConfigPlugin): - TagRegistryGeneratorPlugin + GenerateKnownTagsTask read tag-conventions.yaml (domain) + tag-conventions.java.yaml (Java overlay), resolve per-type tag sets (extends/include/applies, de-duped), assign ids, and greedily graph-color the colorable set into slots. - KnownTagsEmitter writes google-java-format-clean Java to committed internal-api/src/generated (literal id + `// tagId(...)` audit comment). - VerifyKnownTagsTask (verifyKnownTags) regenerates + git-diffs to catch stale commits; generated classes are jacoco-excluded. internal-api: - Deletes the interim hand-maintained src/main KnownTags in favor of the generated src/generated/.../KnownTags.java (byte-equal ids). - Read-through stays chain-aware: keeps parentDenseVisible (multi-level) over the pre-reconcile single-level form. The generated keyOf table uses StringIndex.EmbeddingSupport (matching the tagset base rename) in both the emitter and its committed output, so regeneration is drift-free. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dougqh
force-pushed
the
dougqh/generator-v2
branch
from
July 23, 2026 02:42
7f3d0b1 to
e6800b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Replaces the hand-maintained known-tag table with one generated from a single source of truth (
tag-conventions.yaml+ a Java overlay), so tag ids / the id↔name resolver / (later) per-type layouts stop drifting across core, instrumentation, and language tracers.Generator (buildSrc)
Modeled on
SupportedConfigPlugin(data file →.javaviaPrintWriter):TagRegistryGeneratorPlugin+GenerateKnownTagsTask— readtag-conventions.yaml(domain) +tag-conventions.java.yaml(Java overlay:interceptedhints + virtual/special registry), resolve per-type tag sets (extends/include/applies, de-duped), assign ids in stable serial order, and greedily graph-color the colorable set into slots.KnownTagsEmitter— emits google-java-format-clean Java to committedinternal-api/src/generatedwith a literal id +// tagId(serial=…, group=…, field=…)audit comment (literal ⟹ javac constant-folds; comment ⟹ auditable).verifyKnownTags— regenerates + git-diffs to catch stale commits. Generated classes are jacoco-excluded.Committing the generated sources also lets us audit what ids/layout any release branch shipped via
git checkout.internal-api
src/main/.../KnownTags.javain favor of the generatedsrc/generated/.../KnownTags.java(byte-equal ids — the equivalence gate).parentDenseVisibleover the pre-reconcile single-level form.StringIndex.EmbeddingSupport(matching the tagset base rename) in both the emitter and its committed output, so regeneration is drift-free.Verification
:internal-api:generateKnownTags(no drift),verifyKnownTags,KnownTagsTest,TagMapDenseForkedTest,TagMapDenseFuzzForkedTest,spotlessJavaCheck,spotbugsMain— all green.Stack
tagset → dense-store (#12045) → two-tier bloom (#12046) → **generator**. Basedougqh/bloom-v2. Supersedes old #11961.Non-goals (follow-on)
Wiring
SpanLayoutsinto the dense store; full virtual-dispatch table →TagInterceptorretirement; bandwidth-minimizing packer (greedy is v1).🤖 Generated with Claude Code