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

Remove the zero index from VarZeroVec #5601

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- `zerovec`
- This release has multiple changes that affect the bit representation of various types. Do not update to this release if you wish to retain stable data formats.
- Change the `VarZeroVecFormat` values shipped by default to use the same index and length width. This breaks data layout for all `VarZeroVec`s. (https://github.com/unicode-org/icu4x/pull/5594)
- Change the `VarZeroVec` format to not store a superfluous 0 index at the beginning of the index array. This breaks data layout for all `VarZeroVec`s (https://github.com/unicode-org/icu4x/pull/5601)
- Optimize `MultiFieldsULE` to not store a length anymore. This breaks data layout for any `#[make_varule]`-using struct with multiple variable-sized fields. (https://github.com/unicode-org/icu4x/pull/5593)
- `writeable`

Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions components/plurals/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,10 +1073,10 @@ fn test_serde_nonsingleton_roundtrip() {
assert_eq!(
postcard_bytes,
&[
14, // Postcard header
12, // Postcard header
0x80, // Discriminant
3, b'a', b'b', b'c', // String of length 3
1, 0, 0, 0, // VarZeroVec of length 1
1, 0, // VarZeroVec of length 1
0x10, b'd', b'e', b'f', b'g' // Plural category 1 and string "defg"
]
);
Expand Down
2 changes: 1 addition & 1 deletion components/plurals/src/rules/runtime/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ mod test {
let vzv = VarZeroVec::<_>::from(relations.as_slice());
assert_eq!(
vzv.as_bytes(),
&[1, 0, 0, 0, 192, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]
&[1, 0, 192, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]
);
}
}
2 changes: 1 addition & 1 deletion provider/blob/benches/auxkey_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ fn make_blob_v3() -> Vec<u8> {
put_payloads::<MarkerD>(&mut exporter);
exporter.close().unwrap();
drop(exporter);
assert_eq!(blob.len(), 32980);
assert_eq!(blob.len(), 32974);
assert!(blob.len() > 100);
blob
}
Expand Down
Binary file modified provider/blob/tests/data/v3.postcard
Binary file not shown.
3 changes: 1 addition & 2 deletions provider/blob/tests/test_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ fn test_format() {
let mut blob: Vec<u8> = Vec::new();
let exporter = BlobExporter::new_with_sink(Box::new(&mut blob));
run_driver(exporter, &HelloWorldProvider);
std::fs::write("./tests/data/v3.postcard", blob.as_slice()).unwrap();
assert_eq!(BLOB_V3, blob.as_slice());

let blob_provider = BlobDataProvider::try_new_from_blob(blob.into_boxed_slice()).unwrap();
Expand Down Expand Up @@ -136,7 +135,7 @@ fn test_format_bigger() {
let hash = hasher.finish();

assert_eq!(
hash, 15551798874510060652,
hash, 2996389886987900285,
"V2Bigger format appears to have changed!"
);

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions provider/data/casemap/data/case_map_v1_marker.rs.data

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions provider/data/casemap/fingerprints.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
props/casemap@1, <singleton>, 22513B, 22426B, a4a125633510e06d
props/casemap_unfold@1, <singleton>, 972B, 928B, b861f4456b3907f
props/casemap@1, <singleton>, 22511B, 22424B, ea77be8d954ef566
props/casemap_unfold@1, <singleton>, 968B, 924B, 8871e8e52249b1d5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions provider/data/casemap/stubdata/case_map_v1_marker.rs.data

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading