Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base and the Static Table #1130

Closed
martinthomson opened this issue Feb 21, 2018 · 3 comments
Closed

Base and the Static Table #1130

martinthomson opened this issue Feb 21, 2018 · 3 comments
Labels
-qpack editorial An issue that does not affect the design of the protocol; does not require consensus.

Comments

@martinthomson
Copy link
Member

martinthomson commented Feb 21, 2018

It is not explained at all that the base is applied to the dynamic table only.

That is, index 1 is a straight index into the static table and that index 62 will use the current number of inserts and the base to determine the actual index into the dynamic table (this is the first table entry only when the number of table inserts and base are the same, if the base is smaller, then it will be further along the table).

To be clear, my logic for finding entries is (absent some other bounds-checking, that real code cannot safely omit):

    if i <= 0: error
    if i <= len(staticTable): return staticTable[i-1]
    delta = tableBase - base
    if delta < 0: error
    return dynamicTable[i - len(staticTable) - 1 + delta]

It is probably equally valid to assume that the indices for the static table also increment with each iteration of base, but that leads to approximately the same code anyway.

@martinthomson martinthomson added editorial An issue that does not affect the design of the protocol; does not require consensus. -qpack labels Feb 21, 2018
@afrind
Copy link
Contributor

afrind commented Feb 21, 2018

Perhaps another argument for using separate namespaces for static and dynamic indexes?

@martinthomson
Copy link
Member Author

Possibly, though I'm not convinced that the separation would be worthwhile. Especially if we can reclaim more bits for references by making the instruction opcodes shorter.

@MikeBishop
Copy link
Contributor

In your proposed shorter instructions, we could just use the next bit to differentiate static/dynamic. If we increase the size of the static table, they're equivalent (~128 entries); with the current size, the current arrangement is slightly more compact (albeit less clear to interpret).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-qpack editorial An issue that does not affect the design of the protocol; does not require consensus.
Projects
None yet
Development

No branches or pull requests

3 participants