ruff/crates/red_knot_python_semantic/resources/mdtest
Douglas Creager 444b055cec
[red-knot] Use ternary decision diagrams (TDDs) for visibility constraints (#15861)
We now use ternary decision diagrams (TDDs) to represent visibility
constraints. A TDD is just like a BDD ([_binary_ decision
diagram](https://en.wikipedia.org/wiki/Binary_decision_diagram)), but
with "ambiguous" as an additional allowed value. Unlike the previous
representation, TDDs are strongly normalizing, so equivalent ternary
formulas are represented by exactly the same graph node, and can be
compared for equality in constant time.

We currently have a slight 1-3% performance regression with this in
place, according to local testing. However, we also have a _5× increase_
in performance for pathological cases, since we can now remove the
recursion limit when we evaluate visibility constraints.

As follow-on work, we are now closer to being able to remove the
`simplify_visibility_constraint` calls in the semantic index builder. In
the vast majority of cases, we now see (for instance) that the
visibility constraint after an `if` statement, for bindings of symbols
that weren't rebound in any branch, simplifies back to `true`. But there
are still some cases we generate constraints that are cyclic. With
fixed-point cycle support in salsa, or with some careful analysis of the
still-failing cases, we might be able to remove those.
2025-02-04 14:32:11 -05:00
..
annotations [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
assignment [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
binary [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
boolean [red-knot] Statically known branches (#15019) 2024-12-21 11:33:10 +01:00
boundness_declaredness [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
call [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
comparison [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
comprehensions [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
conditional [red-knot] fix control flow for assignment expressions in elif tests (#15274) 2025-01-05 18:35:29 +00:00
declaration [red-knot] Avoid undeclared path when raising conflicting declarations (#14958) 2024-12-17 09:49:39 +05:30
directives [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
exception [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
expression [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
function [red-knot] function parameter types (#14802) 2024-12-06 12:55:56 -08:00
import [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
literal [red-knot] Migrate bool/str/repr unit tests to Markdown tests (#15534) 2025-01-16 11:21:56 -08:00
loops [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
narrow [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
regression [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
scopes [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
shadowing [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
stubs [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
subscript [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
suppressions [red-knot] Use unambiguous invalid-syntax-construct for suppression comment test (#15933) 2025-02-04 15:24:50 +01:00
type_of [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
type_properties [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
type_qualifiers [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
unary [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
with [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
.mdformat.toml [red-knot] have mdformat wrap mdtest files to 100 columns (#14020) 2024-10-31 21:00:51 +00:00
attributes.md [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
final.md [red-knot] Add support for @final classes (#15070) 2024-12-19 21:02:14 +00:00
generics.md [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
intersection_types.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
invalid_syntax.md [red-knot] Separate invalid syntax code snippets (#14803) 2024-12-06 02:41:33 +00:00
known_constants.md [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
mdtest_config.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
mdtest_custom_typeshed.md [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
metaclass.md [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
mro.md [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
pep695_type_aliases.md [red-knot] Move type_alias_types test to Markdown (#15607) 2025-01-20 09:55:54 +01:00
slots.md [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
statically_known_branches.md [red-knot] Use ternary decision diagrams (TDDs) for visibility constraints (#15861) 2025-02-04 14:32:11 -05:00
sys_platform.md [red-knot] Typeshed sync and sys.platform fixes (#15492) 2025-01-15 11:21:01 +01:00
sys_version_info.md [red-knot] Enforce specifying paths for mdtest code blocks in a separate preceding line (#15890) 2025-02-04 08:27:17 +01:00
terminal_statements.md [red-knot] Consider all definitions after terminal statements unreachable (#15676) 2025-01-29 14:06:57 -05:00
type_api.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
union_types.md [red-knot] Move intersection type tests to Markdown (#15396) 2025-01-10 14:04:03 +01:00
unpacking.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00