Skip to content

ref(symcache): Make parsing backwards-compatible#947

Merged
loewenheim merged 7 commits intomasterfrom
sebastian/symcache-backwards-compat
Apr 13, 2026
Merged

ref(symcache): Make parsing backwards-compatible#947
loewenheim merged 7 commits intomasterfrom
sebastian/symcache-backwards-compat

Conversation

@loewenheim
Copy link
Copy Markdown
Contributor

This puts in some indirection to make it so that old symcache versions remain parseable, even if the on-disk format changes. For the two currently supported versions, 7 and 8, this is massive overkill because they only differ in how string lengths are serialized to the string table. The intention is to enable us to add data to the format without having to throw out every old symcache immediately.

This puts in some indirection to make it so that old symcache versions
remain parseable, even if the on-disk format changes. For the two
currently supported versions, 7 and 8, this is massive overkill because
they only differ in how string lengths are serialized to the string
table. The intention is to enable us to add data to the format without
having to throw out every old symcache immediately.
@loewenheim loewenheim requested a review from a team December 10, 2025 16:09
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.

I haven't reviewed this properly, but why is there a raw:v7 but no raw:v8?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because v7 and v8 use the same on-disk structure. I could duplicate it but they would literally be character-for-character identical. I think I need to document this better.

@jjbayer
Copy link
Copy Markdown
Member

jjbayer commented Dec 17, 2025

If the only difference between V7 and V8 is how it reads strings, I think there's a lot of potential to remove code duplication if you make SymCacheV7 generic over get_string, something like

        trait Dialect {
            fn get_string<'data>() -> &'data str;
        }

        struct V7;
        impl Dialect for V7 {
            fn get_string<'data>() -> &'data str {
                ...
            }
        }

        struct SymCache<D = V7> {
            _d: PhantomData<D>,
        }

        impl<D: Dialect> SymCache<D> {
            fn do_something(&self) {
                let s = D::get_string();
            }
        }

    type SymCacheV8 = SymCacheV7<V8>;

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fbfa9b2. Configure here.

Comment thread symbolic-symcache/src/v8/lookup.rs Outdated
@loewenheim
Copy link
Copy Markdown
Contributor Author

@jjbayer I implemented your suggestion about deduplication and it's a substantial improvement.

@loewenheim loewenheim requested review from a team and jjbayer April 10, 2026 12:40
Copy link
Copy Markdown
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Nice!

@loewenheim loewenheim enabled auto-merge (squash) April 13, 2026 07:56
@loewenheim loewenheim merged commit 080e6d9 into master Apr 13, 2026
18 checks passed
@loewenheim loewenheim deleted the sebastian/symcache-backwards-compat branch April 13, 2026 08:00
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