Skip to content

Commit 964656c

Browse files
committed
Adding missing proto files
1 parent 73553a4 commit 964656c

File tree

4 files changed

+558
-0
lines changed

4 files changed

+558
-0
lines changed

mypy.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[mypy]
2+
python_version = 3.13
3+
mypy_path = src
4+
namespace_packages = True
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
syntax = "proto3";
2+
3+
package io.lionweb.protobuf;
4+
5+
option java_multiple_files = true;
6+
option java_package = "io.lionweb.protobuf";
7+
option java_outer_classname = "ChunkProtos";
8+
9+
// We make use of interned strings, languages, and meta-pointers because this is leading to significant performance
10+
// benefits.
11+
// So many integer values are indexes into tables of interned values.
12+
// Values prefixed with "si_" are string indexes
13+
// Values prefixed with "li_" are language indexes
14+
// Values prefixed with "mpi_" are meta-pointer indexes
15+
//
16+
// Null values for strings and languages are encoded as 0, so indexes into these tables
17+
// are shifted by one. Specifically:
18+
// - During serialization: null → 0; value i → index (i + 1), where i is the position in the interned table.
19+
// - During deserialization: 0 → null; index i → element (i - 1) of the interned table.
20+
21+
message PBChunk {
22+
string serialization_format_version = 1;
23+
24+
// Interned strings
25+
repeated string interned_strings = 2;
26+
repeated PBMetaPointer interned_meta_pointers= 3;
27+
28+
// Interned languages
29+
repeated PBLanguage interned_languages = 4;
30+
repeated PBNode nodes = 5;
31+
}
32+
33+
message PBLanguage {
34+
optional uint32 si_key = 1;
35+
optional uint32 si_version = 2;
36+
}
37+
38+
message PBNode {
39+
// Yes, we should _not_ have null IDs, but if necessary we can represent them
40+
optional uint32 si_id = 1;
41+
uint32 mpi_classifier = 2;
42+
repeated PBProperty properties = 3;
43+
repeated PBContainment containments = 4;
44+
repeated PBReference references = 5;
45+
/* This is a list of indexes representing the string values corresponding to the IDs of the annotations */
46+
repeated uint32 si_annotations = 6 [packed = true];
47+
optional uint32 si_parent = 7;
48+
}
49+
50+
message PBMetaPointer {
51+
// Instead of duplicating language+version as raw numbers everywhere,
52+
// point to the languages table.
53+
uint32 li_language = 1; // index into PBChunk.languages
54+
optional uint32 si_key = 2; // concept/key within that language
55+
}
56+
57+
message PBProperty {
58+
uint32 mpi_meta_pointer = 1;
59+
optional uint32 si_value = 2;
60+
}
61+
62+
message PBContainment {
63+
uint32 mpi_meta_pointer = 1;
64+
repeated uint32 si_children = 2 [packed = true];
65+
}
66+
67+
message PBReference {
68+
uint32 mpi_meta_pointer = 1;
69+
repeated PBReferenceValue values = 2;
70+
}
71+
72+
message PBReferenceValue {
73+
optional uint32 si_resolveInfo = 1;
74+
optional uint32 si_referred = 2;
75+
}

src/lionweb/serialization/proto/Chunk_pb2.py

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)