96 Commits

Author SHA1 Message Date
ecd2b87503 Make Graph cloneable. 2025-01-23 10:46:18 -05:00
0881d16bc3 Remove state-vertex mapping. This simplifies the crate substantially.
Now that VertexRefs can easily be stored in an external data structure,
de-duplication via transposition tables or a hashmap may be handled outside of
the `Graph` struct proper.
2025-01-23 10:45:25 -05:00
b11135b699 Mark EdgeRef and VertexRef as repr(transparent), too. 2025-01-22 14:14:59 -05:00
9ee7882b1f Mark brand types as repr(transparent) to try to ensure safety. 2025-01-22 14:13:58 -05:00
da5f680939 Move game_state_at to open graph state only to avoid Option. 2025-01-21 12:03:29 -05:00
b2c498b845 Go back to using symbol-map for bidirectional game state/vertex map. 2025-01-21 11:31:14 -05:00
c22eb39c7c Major simplification and rewrite.
Generative branding as done in the view module was dogged by the limited
lifetime of a View: you could not hang onto references into a View beyond the
scope of the lifetime brand. This lifetime brand made it difficult to write
generic data structures that used view::NodeRef and view::EdgeRef.

This rewrite makes a Graph and these handle types optionally parameterized by a
lifetime brand. This allows us to simplify things substantially and drop a lot
of code that is no longer necessary.

* src/base.rs: eliminated in favor of putting all types into src/lib.rs.
* src/lib.rs: rewrite Graph to provide operations in terms of EdgeRef and
  VertexRef handle types. Use generative branding to make this zero-cost when
  the user wants it to be.
* src/mark_compact.rs: use new API.
* src/mutators.rs: no longer necessary now that mutation through zero-cost
  handles is available.
* src/nav.rs: no longer necessary now that navigation through zero-cost handles
  is available.
* src/search.rs: no longer necessary because it is trivial to store EdgeRefs and
  VertexRefs while doing graph traversal.
* src/view.rs: functionality folded into the main Graph struct in src/lib.rs.
2025-01-20 22:18:42 -05:00
d90c0911b5 Reformat with rustfmt and abandon 2-space tabs. 2025-01-20 14:16:35 -05:00
4cd221ae01 Bump rustdocs to use newer cross-linking capability. 2025-01-20 14:15:50 -05:00
60719c4ecb Simplify copyright dates in README to account for additional commits. 2025-01-10 09:35:31 -05:00
f93d871370 Update copyright dates in README 2025-01-10 09:34:19 -05:00
4878bf9d14 Remove dependency on the r4 crate. 2025-01-10 09:34:08 -05:00
bde18007b2 Version bump. 2025-01-10 09:29:39 -05:00
4abef5b294 Add missing MutNode.retain_reachable and bump docs. 2025-01-10 09:29:39 -05:00
651ce5fd84 Tighten up mark-and-compact GC.
Now it is in-place and should take less space for at least some workloads. See
TODOs left behind for thoughts on future directions it may make sense to go in
for performance tuning.

This still needs better test coverage, but these code improvements should make
it clear that there are no obvious fundamental flaws to this approach.
2025-01-10 09:29:39 -05:00
d94fd76d94 Use MaybeUninit instead of writing directly into uninitialized Vec.
This addresses a precondition error which is caught in newer stdlib.
2025-01-10 09:29:39 -05:00
1fcff8f4eb Hit it with the cargo fmt bat. 2025-01-10 09:29:39 -05:00
d627b8b964 Accommodate clippy suggestions. 2025-01-10 09:29:39 -05:00
063fedd709 Small readability improvements to satisfy lints. 2025-01-10 09:29:39 -05:00
147e6828d7 Small improvements to doc comments. 2025-01-10 09:29:39 -05:00
f54651ec4d Clean up some compilation warnings. 2025-01-10 09:29:39 -05:00
59e02dd89f Use a type that can actually be named for parent and child iteration in View. 2019-07-30 17:01:32 -04:00
6df253c3cc Fix formatting to be Markdown-friendly. 2019-07-25 22:02:03 -04:00
a35534da10 Bump README and change from org-mode to Markdown. 2019-07-25 22:01:36 -04:00
8af9689fc1 Version bump. 2019-07-25 21:53:40 -04:00
508d31f5b4 Further documentation bump. 2019-07-25 21:53:22 -04:00
112b6865de Move mark & compact GC to top-level module. 2019-07-23 17:56:56 -04:00
650b240dc5 Big documentation bump. More to come. 2019-07-23 17:55:35 -04:00
889c4a6d00 Correct lifetime oversights that lead to unsafety in view.
Some cleanup, too.
2019-07-23 12:53:53 -04:00
e8faceb964 Syntactic cleanup to reduce linebreaks added by rustfmt. 2019-07-23 12:53:17 -04:00
983ca4ca45 Delete empty file. 2019-07-23 12:52:46 -04:00
74d972de59 PartialEq and Eq for EdgeRef/NodeRef. 2019-07-23 01:59:30 -04:00
ff9cdcb0b9 Debug impl for EdgeRef and NodeRef. 2019-07-23 01:45:35 -04:00
4252119879 Version bump for new APIs. 2019-07-23 01:12:29 -04:00
01497be3e8 Ditch AppendOnlyGraph, which was broken and unfixable. 2019-07-23 01:11:59 -04:00
154e49c9f0 Added the view module and a few basic tests. 2019-07-23 01:09:56 -04:00
50bdbb41a7 Improved error message 2019-07-22 12:02:50 -04:00
2bc8e47843 Flesh out AppendOnlyGraph with new append_edge method. 2019-07-17 20:26:25 -04:00
f54bd3ace0 AppendOnlyGraph.add_edge doesn't need &mut self. 2019-07-17 20:07:30 -04:00
8b2011d104 Impl Clone and Copy for nav traits. 2019-07-17 19:32:22 -04:00
2f63b80e36 Add AppendOnlyGraph, to allow safe appends without invalidating pointers. 2019-07-17 19:21:27 -04:00
bbb9be1ae6 Actually add rustfmt.toml. 2019-07-13 23:07:38 -04:00
072a28fa76 Set indentation correctly and run rustfmt on everything. 2019-07-13 23:07:09 -04:00
d6de8fb161 Update to Rust 2018 and use pub(crate) for hidden APIs. 2019-07-13 22:38:17 -04:00
c1a24ff1a6 Use recently published version of symbol_table (now called symbol_map). 2016-09-08 22:02:58 -04:00
b937e22f50 Remove unused import. 2016-09-05 23:47:18 -04:00
e0d34f1f68 Use crossbeam's scoped threads instead of unsafe cast in test. 2016-05-04 14:42:00 -04:00
962768dfb4 Dead simple tests to ensure that Graph can be Send and Sync. 2016-05-01 20:41:14 -04:00
4935b8b646 Remove dead code. 2016-05-01 17:51:55 -04:00
7f8a4b3c0b Switch to using symbol-table package instead of built-in StateNamespace. 2016-05-01 17:51:10 -04:00