eon.process_id¶
Content-addressed process ids (xxHash).
Process table rows and procdata files are keyed by integer ids. A counter
based on len(procs) freezes when duplicate ids collapse the dict; a
counter based on max(id)+1 still couples identity to registration
order and external table rewrites.
Instead, seed the id from a stable xxh64 of the process payload (saddle
geometry bytes, barrier tag, direction). Geometric uniqueness remains
find_repeat; the hash only assigns free keys that do not depend on
table length. Rare collisions (or an already-occupied pure-content hash)
are resolved by salting until free.
Module Contents¶
Functions¶
xxh64 over parts (null-separated), optionally salted. |
|
Return a content-addressed id not already in occupied. |
Data¶
API¶
- eon.process_id.BytesLike¶
None
- eon.process_id.process_id_from_parts(*parts: eon.process_id.BytesLike, salt: int = 0) int¶
xxh64 over parts (null-separated), optionally salted.
Returns a non-negative 63-bit int so it is safe as a dict key and as the
%dfield in processtable /procdata/*_%d.*paths.
- eon.process_id.allocate_unique_process_id(occupied: dict | set | None, *parts: eon.process_id.BytesLike, max_salts: int = 1024) int¶
Return a content-addressed id not already in occupied.
Salt 0 is the pure content hash. If that id is already present (true re-registration of the same payload, or an xxh64 collision), salt until free. Raises if max_salts is exhausted.