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

Clarify whether 'unused' bits are ignored #295

Open
zslayton opened this issue Jan 18, 2024 · 1 comment
Open

Clarify whether 'unused' bits are ignored #295

zslayton opened this issue Jan 18, 2024 · 1 comment
Labels
bug specification 1.1 Ion 1.1 specification work

Comments

@zslayton
Copy link
Contributor

zslayton commented Jan 18, 2024

For example, short-form timestamps can have unused bits. (The high bit in a year timestamp, the high five bits in a month timestamp, etc.)

A writer could reasonably decide to go ahead and encode all time unit fields and then only emit the relevant bytes after the fact, eliminating a lot of branching. In this case, the unused bits could contain 1s; the spec needs to clarify if this is ok or not. Allowing it enables this optimization, but it also complicates direct byte-for-byte comparisons in (e.g.) unit tests.

I'm in favor of it, but want additional input.

@zslayton zslayton added the bug label Jan 18, 2024
@zslayton zslayton changed the title Clarify whether 'unused' short-form timestamp bits are ignored Clarify whether 'unused' bits are ignored Feb 7, 2024
@zslayton
Copy link
Contributor Author

zslayton commented Feb 7, 2024

@popematt raised a related question in this PR:

[...in the encoding for long-form timestamp...] If there's "day" precision, then the day will already be non-zero. If anything, shouldn't we be zero-ing the day if it's month precision?

@popematt popematt added the specification 1.1 Ion 1.1 specification work label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug specification 1.1 Ion 1.1 specification work
Projects
None yet
Development

No branches or pull requests

2 participants