Make specialization name encoding collision-safe - #633
Conversation
d8d9b0e to
b9466f6
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
02daf7c to
8bac246
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| using namespace string; | ||
| using namespace pod; | ||
|
|
||
| std::string BuildShortTypeString::escapeSpecialCharacters(StringRef value) { |
There was a problem hiding this comment.
This is a duplicate of some code you have in another PR, so refer to my comments there: https://github.com/project-llzk/llzk-lib/pull/634/changes#r3646683046
|
@1sgtpepper there's a real bug here as witnessed by Multiple passes can perform some kind of partial instantiation that adds the placeholder character: One foolproof solution would be a verification on all input IR to ensure the |
This feedback also applies to #634 which has a similar function. |
|
Should |
Probably so, but we'll get @tim-hoffman's input as well. |
I'm putting together some test cases to exercise the specific problems I mentioned. |
|
Ill hold off on #634 until this is cleared so I can reconcile the two. |
|
@1sgtpepper #646 adds some tests that would end up with mangled/reordered names due to changes in this PR. Hopefully that clears up the issue I was describing. In the "foolproof" solution I mentioned before, modules included via |
|
Thanks for #646 been looking into this and seems more messy than I initially thought, I'll share my thoughts soon since this also affects my adjacent prs substantially(it seems) |
|
Thanks—#646 convinced me that the spelling itself is the wrong place to retain slot state. My proposal is to store literal name chunks on Two questions:
I'd keep the rest out of this PR. |
|
Leaning toward an optional inherent ODS name_pattern backed by ArrayAttr, since later passes rely on it. When absent, the entire sym_name is opaque, regardless of whether parameters remain; slots are never inferred from marker bytes. I’d keep the scope to the existing partial-template refinement paths, plus a pass-local exact cache replacing rendered-name reuse for partial functions. |
|
@1sgtpepper I'd lean toward a verified generic |
|
A verified generic Is it okay for a missing attribute to mean the entire name is opaque, with no legacy slot reconstruction? |
Yes. That should be fine. |
dfa8b09 to
730a268
Compare
Part of #479 (approved); split from #604.
Summary
Preserve literal source-name bytes and partial-template name positions across specialization passes. Partial function reuse is keyed by the exact source function and concrete bindings rather than rendered symbol names.
Changes
poly.name_patternmetadata containing literal chunks around the current template parameters; absent metadata leaves the entire symbol name opaque.Testing
nix develop --command bash -c "cmake --build build --target llzk-opt -j1"llzk-opt/FileCheck and-verify-diagnosticspipelines for flattening, type-variable inference, wildcard specialization, malformedpoly.name_pattern, and the existing felt-field diagnostic.check-llzk-tests.sh upstream/mainscripts/generate-test-checks.pystdout dry-run: 57 split outputs validated. Two splits expose an existing generator limitation with inline#felt.field/#felt<const>attributes; all committed complete output checks pass.Documentation and changelog
The
poly.templateTableGen documentation describes the metadata contract, and the required unreleased changelog entry is included.Allow edits from maintainers is enabled.
AI assistance
Tools used: Codex
How the tools contributed: Implementation.
How I verified the contribution: Reviewed the final diff against agreed upon maintainer direction; ran the exact-head build, focused FileCheck and diagnostic pipelines, generator dry-runs, a surface audit, and confirmed all 9 GitHub Actions checks passed.