All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- The
Appendabletrait has been simplified. ItsCtxtype parameter is gone, in favor of a separate traitToAppendablethat is used to find appendables for a handle. The type itself moved from thecyclesto thestitchingmodule. - The
ForwardPartialPathStitcherhas been generalized so that it can be used to build paths from a database or from graph edges. It now takes a type parameter indicating the type of candidates it uses. Instead of aDatabaseinstance, it expects a value that implements theCandidatesandToAppendabletraits. TheForwardPartialPathStitcher::process_next_phaseexpects an additionalextend_untilclosure that controls whether the extended paths are considered for further extension or not (using|_,_,_| trueretains old behavior). - The SQLite database implementation is using a new schema which stores binary instead of JSON values, resulting in faster write times and smaller databases.
- A panic in
AppendingCycleDetector::is_cyclicthat occurred because variables were not always renamed before attempting to concatenate partial paths. - An inverted condition in
PartialSymbolStack::has_variablethat resulted in incorrect return values. - A bug in
Partial*Stack::unifythat resulted in recursive bindings ($1 => SYMBOL,$1). Any unification that would result in a recursive binding now returns an error. - A bug in
PartialPath::appendthat would incorrectly allow appending edges that added symbols to the precondition symbol stack, even if that stack had no variable.
- The
ForwardPartialPathStitcher::from_nodesfunction has been removed. Callers are responsible for creating the right initial paths, which can be done usingPartialPath::from_node. - The
PartialPaths::find_minimal_partial_path_set_in_filemethod has been removed in favor ofForwardPartialPathStitcher::find_minimal_partial_path_set_in_file. - The
PartialPaths::find_all_complete_pathsmethod has been removed in favor ofForwardPartialPathStitcher::find_all_complete_partial_pathsusingGraphEdges(None)for thedbargument. - The
OwnedOrDatabasePathhas been removed because it was obsolete with the changes toAppendable.
- New
DefinesandRefersassertions test for the presence of definitions and references, respectively, without resolution. - A method
StackGraph::get_fileto look up an existing file. - A field named
fully_qualified_namewas added toSourceInfo. - A new
serdemodule (requiring theserdefeature) adds serialization and deserialization of stack graphs and partial paths. - Stack graphs can now record debug information for edges as it did for noeds. This is also displayed in the HTML visualization when hovering over an edge arrow.
- A new
storagemodule (requiring thestoragefeature) implements a simple SQLite database for storing stack graphs and partial paths.
- A bug in
PartialPath::concatenatethat prevented stitching partial paths that were joined at a pop or push node.
- The
IncorrectDefinitionserror is renamed toIncorrectlyDefined, andIncorrectDefinitionsis the error used for theDefinesassertion. - The
PartialPaths::find_all_partial_paths_in_filemethod has been replaced byPartialPaths::find_minimal_partial_path_set_in_file, which computes a smaller set. TheForwardPartialPathStitcher::find_locally_maximal_partial_path_setfunction can be used to compute the set previously returned byfind_all_partial_paths_in_filefrom the minimal partial path set. - The cycle detection algorithm, which had the dual repsonisbility of detecting path cycles and culling duplicate paths, has been replaced by a new approach consisting of a new cycle detection algorithm and an optional duplicate path detection algorithm. This fixes issues with the old approach which was based on a heuristic and would sometimes keep too many paths, and sometimes throw away too many. The new algorithms are precise instead of using a heuristic and resolve unpredictable resolution behavior.
- An empty scope stack postcondition is not required anymore for a path to be considered complete. (Symbol stack postconditions must still be empty in complete paths!)
- The visualization code requires the
visualizationfeature instead of thejsonfeature, and implies theserdefeature. - A new
CancelAfterDurationcancellation flag implementation has been added to easily set timeout-based cancellation.
- The method
StackGraph::get_file_uncheckedis removed. Use the newStackGraph::get_fileinstead. - All the functionality related to
Pathhas been removed in favor of usingPartialPath. In general, thePathbehavior of can be achieved by using aPartialPathwith finite preconditions (i.e., no symbol or scope stack variables), which can be created usingPartialPath::eliminate_precondition_stack_variables.
- The up and down text arrows in the labels of push and pop nodes in the visualization have been replaced by bigger arrows that are part of the node shape. This makes it easier to quickly identify push and pop nodes in the graph.
- The
bitvecdependency was updated to fix installation problems.
- The amount of work done in
PartialPaths::find_all_partial_paths_in_fileis reduced. The documentation now makes it clear that the function itself is responsible for returning a set that is big enough to cover all complete paths. Callers should not have to filter this set further anymore, and any visitors filtering withPartialPath::is_complete_as_possibleorPartialPath::is_productiveshould remove those checks, as they may interfere with future ompitmizations of this fynction.
- Cancellation of potentially long-running operations is now supported
by passing an implementation of the
CancellationFlagtrait. TheNoCancellationtype provides a noop implementation.
Assertion::runrequires an extra cancellation flag parameter.PartialPaths::find_all_partial_paths_in_file,Paths::find_all_paths,Paths::remove_shadowed_paths,PathStitcher::find_all_complete_pathsandForwardPartialPathStitcher::find_all_complete_partial_pathsrequire an extra cancellation flag parameter and now return aResultto indicate if the computation was successful or cancelled.- C API functions
sg_path_arena_find_all_complete_pathsandsg_partial_path_arena_find_partial_paths_in_filerequire an extra parameterconst size_t *cancellation_flagparameter and return ansg_resultvalue to indicate if the operation was successful or cancelled. A null pointer can be passed if no cancellation is necessary.
- C API functions
sg_partial_path_database_ensure_both_directionsandsg_partial_path_database_ensure_forwardsto ensure the available directions of deques in partial paths in a database.
- Source info field
definiens_spanfor the source span that corresponds to the definiens of a function declaration (i.e. the body of a function declaration, not an assignment).
- We no longer add divergent partial paths to a
Database. A divergent partial path starts at the root node and has an empty symbol stack precondition. That empty precondition means that it can be concatenated to any path that currently ends at the root node — including the result of that concatenation! That gives us a divergence, since we can continually prepend the path's postcondition to the current symbol stack, forever. To avoid this divergence, we skip these partial paths when constructing a database.
- Method
StackGraph::add_from_graphto copy the one graph into another.
- Resolves build problems of version 0.7.0
-
The module
stack_graphs::assertdefines assertions that can be run against a stack graph to test resolution behavior. -
The module
stack_graphs::jsondefines JSON rendering of stack graphs and paths. This module requires thejsonfeature. -
The module
stack_graphs::visualizationdefines rendering an interactive HTML visualization of stack graphs. This module requires thejsonfeature. -
Stack graph nodes can have associated
DebugInfo, consisting of key-value pairs of strings.
-
Internal and exported scopes as separate node types are removed and replaced by a single scope node type. Whether a scope is exported is indicated by a boolean attribute.
The
Node::{Exported,Internal}Scopeare replaced by a singleNode::Scope, and their implementation types{Exported,Internal}ScopeNodeare replaced by the typeScopeNode. TheScopeNode::is_exportedfield indicates whether a scope is exported or internal. TheStackGraph::add_{internal,exported}_scope_nodemethods are replaced byStackGraph::add_scope_node.In the C API, the enum values
sg_node_kind::SG_NODE_KIND_EXPORTED_SCOPEandsg_node_kind:SG_NODE_KIND_INTERNAL_SCOPEare replaced by a single valuesg_node_kind::SG_NODE_KIND_SCOPE. The fieldsg_node::is_clickableis renamed tosg_node::is_endpoint.
- The new
ForwardPartialPathStitcher::from_partial_pathsconstructor lets you seed a path stitching search with a specific list of partial paths (which need not be in theDatabase). This can be used, for instance, to implement “find qualified definitions”, where we look for any definition of a fully qualified name (expressed as a symbol stack). There is a new test case that shows an example implementation.
- The
ForwardPartialPathStitcher::newconstructor has been renamed tofrom_nodes, to be more consistent with the newfrom_partial_pathsconstructor.
-
Added the ability to bound the amount of work performed in each phase of the path stitching algorithm. Exposed in the C API via the following functions:
sg_forward_path_stitcher_set_max_work_per_phasesg_forward_partial_path_stitcher_set_max_work_per_phase
-
Added a
grapheme_offsetfield to thesg_offsettype in the C API, to track grapheme positions along with UTF-8 and UTF-16 positions.