Peano
Loading...
Searching...
No Matches
test_propagate_use_statements Namespace Reference

Data Structures

class  _FakeSubmodel
 Minimal stand-in for a peano4.api.datamodel.Patch: propagate_use_statements() only ever needs submodel identity, never anything Patch-specific. More...
 

Functions

 _chain_graph (name_prefix, length)
 A step sequence of length steps.
 
 _use_cell (step, submodel, qualifier)
 
 _use_face (step, submodel, qualifier)
 
 _use_vertex (step, submodel, qualifier)
 
 _access (task, attribute_name="cell_data_access")
 
 test_immediate_read_after_write_is_already_valid ()
 Distance 1, WRITE then READ_AND_DISCARD: nothing to do.
 
 test_immediate_readwrite_after_write_is_already_valid ()
 Distance 1, WRITE then READ_AND_WRITE: also fine.
 
 test_immediate_write_after_write_supersedes_needs_no_relay ()
 Distance 1, WRITE then WRITE again: the second WRITE is a fresh, independent production (e.g.
 
 test_write_then_write_then_read_finds_the_real_read_past_the_superseding_write ()
 A WRITE at N is immediately followed by another WRITE at N+1 - N's own search stops right there with nothing to do (superseded).
 
 test_distance_two_inserts_readwrite_in_between ()
 Worked example 1: task N writes, task N+2 reads, nothing in between mentions the submodel (distance 2, even) - fixed by inserting a READ_AND_WRITE declaration on task N+1.
 
 test_distance_three_needs_no_change ()
 Worked example 2: task N writes, task N+3 reads (distance 3, odd) - already fine as it stands.
 
 test_distance_four_inserts_readwrite_immediately_before_the_read ()
 Worked example 3: task N writes, task N+4 reads (distance 4, even) - fixed by inserting a READ_AND_WRITE declaration on task N+3, not N+1.
 
 test_temporary_declaration_is_transparent_to_the_search ()
 A TEMPORARY use in between is treated exactly like a task that does not mention the submodel at all: task N writes, task N+1 already has a (user-declared) TEMPORARY use of the same submodel, task N+3 reads - the distance that matters is still N to N+3 (distance 3, odd, fine), not N to N+1 (which would wrongly look like an immediate non-read).
 
 test_read_origin_triggers_nothing ()
 A READ_AND_DISCARD never obliges anything downstream - even an immediately following task that does not mention the submodel at all is fine.
 
 test_temporary_origin_triggers_nothing ()
 Same for TEMPORARY.
 
 test_readwrite_origin_is_treated_like_write ()
 READ_AND_WRITE both reads and writes, so - like a plain WRITE - it still obliges whatever comes next (distance 2 here, needs a relay).
 
 test_is_idempotent ()
 A second call once everything is already admissible must change nothing and report False.
 
 test_cell_face_and_vertex_are_propagated_independently ()
 
 test_graph_with_no_edges_is_analysed_on_its_own ()
 A graph does not need any edge at all to be analysed - it is simply treated as a self-contained sequence, exactly like the old PropagateUseStatements used to for a single already-compiled Step sequence.
 
 test_gap_across_a_cross_graph_edge_is_fixed_in_the_right_graph ()
 A's last task writes; B's first task is at distance 2 across the (A, B) edge (one silent task in between, in A) - the relay has to be inserted into A (the task exactly one before B's first task), not B.
 
 test_self_edge_propagates_across_the_wrap_around ()
 A (graph, graph) self-edge is what replaces the old Graph.cyclic flag: a graph's last task writing and its own first task reading, at distance 1 across the wrap-around, is already valid.
 
 test_self_edge_wrap_around_gap_is_fixed ()
 Same wrap-around, but with a genuine gap needing a relay: the last task writes, the graph's own first task is silent, and the real reader is the second task - distance 2 via the wrap (last -> first (silent, distance 1) -> second (read, distance 2)), matching worked example 1 but reached through the self-edge instead of a plain successor.
 
 test_without_the_self_edge_the_wrap_around_is_not_considered ()
 Without a (graph, graph) edge, a graph's own last task is a dead end - nothing wraps back to its first task, so a write at the last task with no further use is simply left alone.
 
 test_branching_successor_graphs_are_each_fixed_independently ()
 Setup -> TimeStep and Setup -> Plot: a submodel Setup last writes has to reach a real reader down either branch, and each branch is fixed on its own terms (here: TimeStep's reader sits at distance 2, needing a relay; Plot's sits at distance 1, already valid).
 
 test_time_step_and_plot_composed_in_both_directions ()
 TimeStep and Plot may follow one another in either order - a submodel TimeStep's last task writes and only Plot's first task reads, at distance 1, is already valid down that path.
 
 test_write_immediately_after_readwrite_is_upgraded ()
 A READ_AND_WRITE explicitly asks for its value to be kept around - a WRITE immediately after it would otherwise silently discard that value (predicateForLoad false for a plain WRITE), so it gets upgraded to READ_AND_WRITE instead of being left as a superseding WRITE.
 
 test_write_immediately_after_write_is_not_upgraded ()
 Contrast with the above: a WRITE immediately after another plain WRITE is the legitimate "recompute this fresh every time" pattern and is deliberately left alone - only a READ_AND_WRITE predecessor (which explicitly asked to survive) triggers the upgrade.
 
 test_write_immediately_after_readwrite_across_an_edge_is_upgraded ()
 The same upgrade, but with the READ_AND_WRITE the last task of one graph and the WRITE the first task of a successor graph.
 
 test_write_immediately_after_write_via_self_edge_is_not_upgraded ()
 The wrap-around counterpart of test_write_immediately_after_write_is_not_upgraded(): a single-task graph whose one task WRITEs and self-repeats (e.g.
 
 test_upgrade_runs_before_relay_insertion_so_no_relay_is_needed ()
 Mirrors exahype2.api.fv.RusanovWithExplicitEuler's own task graph: task 0 READ_AND_WRITEs, task 1 WRITEs (upgraded to READ_AND_WRITE by this pass), task 2 READ_AND_WRITEs again - once task 1 is upgraded, every remaining gap is distance 1 (odd), so no relay is ever needed.
 
 test_relay_upgrades_a_temporary_declaration ()
 A TEMPORARY use does not relay the submodel through the stacks.
 
 test_distances_count_fused_steps_not_tasks ()
 Four tasks (cell WRITE, vertex, cell, vertex READ_AND_DISCARD) are three tasks apart, which would be fine.
 
 test_read_before_any_write_adds_write_to_last_step_of_entry_sequence ()
 Setup never touches Q, the time step reads it first: the last setup step creates it.
 
 test_read_before_any_write_via_plot_detour_also_relays_through_plot ()
 Setup may be followed by a plot first, which does not use Q: the WRITE goes into setup, and the plot relays Q to the time step.
 
 test_read_before_write_within_entry_sequence_is_not_changed ()
 There is no earlier sequence to create Q in: nothing changes.
 
 test_write_before_read_needs_no_creation ()
 Setup writes Q, so nothing has to be created.
 
 test_discard_followed_by_read_is_upgraded ()
 Two sibling consumers in subsequent steps: the first must keep Q.
 
 test_discard_followed_by_write_is_not_upgraded ()
 The next use produces Q afresh: discarding is fine.
 
 test_discard_followed_by_read_at_even_distance_gets_a_relay ()
 The upgraded declaration is an origin like any other: a reader two steps later gets a relay in between.
 

Variables

 READ_AND_DISCARD = Task.DataAccess.READ_AND_DISCARD
 
 WRITE = Task.DataAccess.WRITE
 
 READ_AND_WRITE = Task.DataAccess.READ_AND_WRITE
 
 TEMPORARY = Task.DataAccess.TEMPORARY
 

Function Documentation

◆ _access()

◆ _chain_graph()

test_propagate_use_statements._chain_graph (   name_prefix,
  length 
)
protected

A step sequence of length steps.

Returned twice: once as the sequence handed to propagate_use_statements(), once as the list of steps the tests inspect - both are the same list object.

Definition at line 30 of file test_propagate_use_statements.py.

Referenced by test_branching_successor_graphs_are_each_fixed_independently(), test_cell_face_and_vertex_are_propagated_independently(), test_discard_followed_by_read_at_even_distance_gets_a_relay(), test_discard_followed_by_read_is_upgraded(), test_discard_followed_by_write_is_not_upgraded(), test_distance_four_inserts_readwrite_immediately_before_the_read(), test_distance_three_needs_no_change(), test_distance_two_inserts_readwrite_in_between(), test_gap_across_a_cross_graph_edge_is_fixed_in_the_right_graph(), test_graph_with_no_edges_is_analysed_on_its_own(), test_immediate_read_after_write_is_already_valid(), test_immediate_readwrite_after_write_is_already_valid(), test_immediate_write_after_write_supersedes_needs_no_relay(), test_is_idempotent(), test_read_before_any_write_adds_write_to_last_step_of_entry_sequence(), test_read_before_any_write_via_plot_detour_also_relays_through_plot(), test_read_before_write_within_entry_sequence_is_not_changed(), test_read_origin_triggers_nothing(), test_readwrite_origin_is_treated_like_write(), test_relay_upgrades_a_temporary_declaration(), test_self_edge_propagates_across_the_wrap_around(), test_self_edge_wrap_around_gap_is_fixed(), test_temporary_declaration_is_transparent_to_the_search(), test_temporary_origin_triggers_nothing(), test_time_step_and_plot_composed_in_both_directions(), test_upgrade_runs_before_relay_insertion_so_no_relay_is_needed(), test_without_the_self_edge_the_wrap_around_is_not_considered(), test_write_before_read_needs_no_creation(), test_write_immediately_after_readwrite_across_an_edge_is_upgraded(), test_write_immediately_after_readwrite_is_upgraded(), test_write_immediately_after_write_is_not_upgraded(), test_write_immediately_after_write_via_self_edge_is_not_upgraded(), and test_write_then_write_then_read_finds_the_real_read_past_the_superseding_write().

Here is the caller graph for this function:

◆ _use_cell()

test_propagate_use_statements._use_cell (   step,
  submodel,
  qualifier 
)
protected

Definition at line 41 of file test_propagate_use_statements.py.

Referenced by test_branching_successor_graphs_are_each_fixed_independently(), test_cell_face_and_vertex_are_propagated_independently(), test_discard_followed_by_read_at_even_distance_gets_a_relay(), test_discard_followed_by_read_is_upgraded(), test_discard_followed_by_write_is_not_upgraded(), test_distance_four_inserts_readwrite_immediately_before_the_read(), test_distance_three_needs_no_change(), test_distance_two_inserts_readwrite_in_between(), test_gap_across_a_cross_graph_edge_is_fixed_in_the_right_graph(), test_graph_with_no_edges_is_analysed_on_its_own(), test_immediate_read_after_write_is_already_valid(), test_immediate_readwrite_after_write_is_already_valid(), test_immediate_write_after_write_supersedes_needs_no_relay(), test_is_idempotent(), test_read_before_any_write_adds_write_to_last_step_of_entry_sequence(), test_read_before_any_write_via_plot_detour_also_relays_through_plot(), test_read_before_write_within_entry_sequence_is_not_changed(), test_read_origin_triggers_nothing(), test_readwrite_origin_is_treated_like_write(), test_relay_upgrades_a_temporary_declaration(), test_self_edge_propagates_across_the_wrap_around(), test_self_edge_wrap_around_gap_is_fixed(), test_temporary_declaration_is_transparent_to_the_search(), test_temporary_origin_triggers_nothing(), test_time_step_and_plot_composed_in_both_directions(), test_upgrade_runs_before_relay_insertion_so_no_relay_is_needed(), test_without_the_self_edge_the_wrap_around_is_not_considered(), test_write_before_read_needs_no_creation(), test_write_immediately_after_readwrite_across_an_edge_is_upgraded(), test_write_immediately_after_readwrite_is_upgraded(), test_write_immediately_after_write_is_not_upgraded(), test_write_immediately_after_write_via_self_edge_is_not_upgraded(), and test_write_then_write_then_read_finds_the_real_read_past_the_superseding_write().

Here is the caller graph for this function:

◆ _use_face()

test_propagate_use_statements._use_face (   step,
  submodel,
  qualifier 
)
protected

Definition at line 46 of file test_propagate_use_statements.py.

Referenced by test_cell_face_and_vertex_are_propagated_independently().

Here is the caller graph for this function:

◆ _use_vertex()

test_propagate_use_statements._use_vertex (   step,
  submodel,
  qualifier 
)
protected

Definition at line 51 of file test_propagate_use_statements.py.

Referenced by test_cell_face_and_vertex_are_propagated_independently().

Here is the caller graph for this function:

◆ test_branching_successor_graphs_are_each_fixed_independently()

test_propagate_use_statements.test_branching_successor_graphs_are_each_fixed_independently ( )

Setup -> TimeStep and Setup -> Plot: a submodel Setup last writes has to reach a real reader down either branch, and each branch is fixed on its own terms (here: TimeStep's reader sits at distance 2, needing a relay; Plot's sits at distance 1, already valid).

Definition at line 351 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_cell_face_and_vertex_are_propagated_independently()

test_propagate_use_statements.test_cell_face_and_vertex_are_propagated_independently ( )

Definition at line 247 of file test_propagate_use_statements.py.

References _chain_graph(), _use_cell(), _use_face(), and _use_vertex().

Here is the call graph for this function:

◆ test_discard_followed_by_read_at_even_distance_gets_a_relay()

test_propagate_use_statements.test_discard_followed_by_read_at_even_distance_gets_a_relay ( )

The upgraded declaration is an origin like any other: a reader two steps later gets a relay in between.

Definition at line 648 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_discard_followed_by_read_is_upgraded()

test_propagate_use_statements.test_discard_followed_by_read_is_upgraded ( )

Two sibling consumers in subsequent steps: the first must keep Q.

Definition at line 620 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_discard_followed_by_write_is_not_upgraded()

test_propagate_use_statements.test_discard_followed_by_write_is_not_upgraded ( )

The next use produces Q afresh: discarding is fine.

Definition at line 635 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_distance_four_inserts_readwrite_immediately_before_the_read()

test_propagate_use_statements.test_distance_four_inserts_readwrite_immediately_before_the_read ( )

Worked example 3: task N writes, task N+4 reads (distance 4, even) - fixed by inserting a READ_AND_WRITE declaration on task N+3, not N+1.

Definition at line 154 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_distance_three_needs_no_change()

test_propagate_use_statements.test_distance_three_needs_no_change ( )

Worked example 2: task N writes, task N+3 reads (distance 3, odd) - already fine as it stands.

Definition at line 139 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_distance_two_inserts_readwrite_in_between()

test_propagate_use_statements.test_distance_two_inserts_readwrite_in_between ( )

Worked example 1: task N writes, task N+2 reads, nothing in between mentions the submodel (distance 2, even) - fixed by inserting a READ_AND_WRITE declaration on task N+1.

Definition at line 123 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_distances_count_fused_steps_not_tasks()

test_propagate_use_statements.test_distances_count_fused_steps_not_tasks ( )

Four tasks (cell WRITE, vertex, cell, vertex READ_AND_DISCARD) are three tasks apart, which would be fine.

FuseSteps however compiles them into the traversals [A], [B, C], [D], i.e. the read is two traversals after the write, and a relay is required on the fused step [B, C].

Definition at line 506 of file test_propagate_use_statements.py.

References _access().

Here is the call graph for this function:

◆ test_gap_across_a_cross_graph_edge_is_fixed_in_the_right_graph()

test_propagate_use_statements.test_gap_across_a_cross_graph_edge_is_fixed_in_the_right_graph ( )

A's last task writes; B's first task is at distance 2 across the (A, B) edge (one silent task in between, in A) - the relay has to be inserted into A (the task exactly one before B's first task), not B.

Definition at line 287 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_graph_with_no_edges_is_analysed_on_its_own()

test_propagate_use_statements.test_graph_with_no_edges_is_analysed_on_its_own ( )

A graph does not need any edge at all to be analysed - it is simply treated as a self-contained sequence, exactly like the old PropagateUseStatements used to for a single already-compiled Step sequence.

Definition at line 266 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_immediate_read_after_write_is_already_valid()

test_propagate_use_statements.test_immediate_read_after_write_is_already_valid ( )

Distance 1, WRITE then READ_AND_DISCARD: nothing to do.

Definition at line 65 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_immediate_readwrite_after_write_is_already_valid()

test_propagate_use_statements.test_immediate_readwrite_after_write_is_already_valid ( )

Distance 1, WRITE then READ_AND_WRITE: also fine.

Definition at line 78 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_immediate_write_after_write_supersedes_needs_no_relay()

test_propagate_use_statements.test_immediate_write_after_write_supersedes_needs_no_relay ( )

Distance 1, WRITE then WRITE again: the second WRITE is a fresh, independent production (e.g.

ProjectPatchOntoFaces recomputing face data from scratch every time step) - it does not need to read what the first WRITE produced, so there is nothing to protect and nothing to do, even though the two are immediately adjacent.

Definition at line 90 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_is_idempotent()

test_propagate_use_statements.test_is_idempotent ( )

A second call once everything is already admissible must change nothing and report False.

Definition at line 229 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_read_before_any_write_adds_write_to_last_step_of_entry_sequence()

test_propagate_use_statements.test_read_before_any_write_adds_write_to_last_step_of_entry_sequence ( )

Setup never touches Q, the time step reads it first: the last setup step creates it.

Definition at line 542 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_read_before_any_write_via_plot_detour_also_relays_through_plot()

test_propagate_use_statements.test_read_before_any_write_via_plot_detour_also_relays_through_plot ( )

Setup may be followed by a plot first, which does not use Q: the WRITE goes into setup, and the plot relays Q to the time step.

Definition at line 561 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_read_before_write_within_entry_sequence_is_not_changed()

test_propagate_use_statements.test_read_before_write_within_entry_sequence_is_not_changed ( )

There is no earlier sequence to create Q in: nothing changes.

Definition at line 587 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_read_origin_triggers_nothing()

test_propagate_use_statements.test_read_origin_triggers_nothing ( )

A READ_AND_DISCARD never obliges anything downstream - even an immediately following task that does not mention the submodel at all is fine.

Definition at line 189 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_readwrite_origin_is_treated_like_write()

test_propagate_use_statements.test_readwrite_origin_is_treated_like_write ( )

READ_AND_WRITE both reads and writes, so - like a plain WRITE - it still obliges whatever comes next (distance 2 here, needs a relay).

Definition at line 215 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_relay_upgrades_a_temporary_declaration()

test_propagate_use_statements.test_relay_upgrades_a_temporary_declaration ( )

A TEMPORARY use does not relay the submodel through the stacks.

If the relay has to go onto a step that already declares the submodel TEMPORARY, that declaration is upgraded to READ_AND_WRITE.

Definition at line 484 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_self_edge_propagates_across_the_wrap_around()

test_propagate_use_statements.test_self_edge_propagates_across_the_wrap_around ( )

A (graph, graph) self-edge is what replaces the old Graph.cyclic flag: a graph's last task writing and its own first task reading, at distance 1 across the wrap-around, is already valid.

Definition at line 305 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_self_edge_wrap_around_gap_is_fixed()

test_propagate_use_statements.test_self_edge_wrap_around_gap_is_fixed ( )

Same wrap-around, but with a genuine gap needing a relay: the last task writes, the graph's own first task is silent, and the real reader is the second task - distance 2 via the wrap (last -> first (silent, distance 1) -> second (read, distance 2)), matching worked example 1 but reached through the self-edge instead of a plain successor.

Definition at line 319 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_temporary_declaration_is_transparent_to_the_search()

test_propagate_use_statements.test_temporary_declaration_is_transparent_to_the_search ( )

A TEMPORARY use in between is treated exactly like a task that does not mention the submodel at all: task N writes, task N+1 already has a (user-declared) TEMPORARY use of the same submodel, task N+3 reads - the distance that matters is still N to N+3 (distance 3, odd, fine), not N to N+1 (which would wrongly look like an immediate non-read).

Definition at line 171 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_temporary_origin_triggers_nothing()

test_propagate_use_statements.test_temporary_origin_triggers_nothing ( )

Same for TEMPORARY.

Definition at line 204 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_time_step_and_plot_composed_in_both_directions()

test_propagate_use_statements.test_time_step_and_plot_composed_in_both_directions ( )

TimeStep and Plot may follow one another in either order - a submodel TimeStep's last task writes and only Plot's first task reads, at distance 1, is already valid down that path.

(Self-edges are deliberately left out here - a single-task graph whose only task both writes and self-repeats would conflict with itself immediately, which is a separate scenario covered by the self-edge tests above.)

Definition at line 375 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_upgrade_runs_before_relay_insertion_so_no_relay_is_needed()

test_propagate_use_statements.test_upgrade_runs_before_relay_insertion_so_no_relay_is_needed ( )

Mirrors exahype2.api.fv.RusanovWithExplicitEuler's own task graph: task 0 READ_AND_WRITEs, task 1 WRITEs (upgraded to READ_AND_WRITE by this pass), task 2 READ_AND_WRITEs again - once task 1 is upgraded, every remaining gap is distance 1 (odd), so no relay is ever needed.

Definition at line 465 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_without_the_self_edge_the_wrap_around_is_not_considered()

test_propagate_use_statements.test_without_the_self_edge_the_wrap_around_is_not_considered ( )

Without a (graph, graph) edge, a graph's own last task is a dead end - nothing wraps back to its first task, so a write at the last task with no further use is simply left alone.

Definition at line 337 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_write_before_read_needs_no_creation()

test_propagate_use_statements.test_write_before_read_needs_no_creation ( )

Setup writes Q, so nothing has to be created.

Definition at line 599 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_write_immediately_after_readwrite_across_an_edge_is_upgraded()

test_propagate_use_statements.test_write_immediately_after_readwrite_across_an_edge_is_upgraded ( )

The same upgrade, but with the READ_AND_WRITE the last task of one graph and the WRITE the first task of a successor graph.

Definition at line 434 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_write_immediately_after_readwrite_is_upgraded()

test_propagate_use_statements.test_write_immediately_after_readwrite_is_upgraded ( )

A READ_AND_WRITE explicitly asks for its value to be kept around - a WRITE immediately after it would otherwise silently discard that value (predicateForLoad false for a plain WRITE), so it gets upgraded to READ_AND_WRITE instead of being left as a superseding WRITE.

Definition at line 401 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_write_immediately_after_write_is_not_upgraded()

test_propagate_use_statements.test_write_immediately_after_write_is_not_upgraded ( )

Contrast with the above: a WRITE immediately after another plain WRITE is the legitimate "recompute this fresh every time" pattern and is deliberately left alone - only a READ_AND_WRITE predecessor (which explicitly asked to survive) triggers the upgrade.

Definition at line 418 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_write_immediately_after_write_via_self_edge_is_not_upgraded()

test_propagate_use_statements.test_write_immediately_after_write_via_self_edge_is_not_upgraded ( )

The wrap-around counterpart of test_write_immediately_after_write_is_not_upgraded(): a single-task graph whose one task WRITEs and self-repeats (e.g.

ProjectPatchOntoFaces recomputing face data fresh every time step) must not get upgraded just because it is - via the self-edge - immediately "after" its own previous WRITE.

Definition at line 449 of file test_propagate_use_statements.py.

References _access(), _chain_graph(), and _use_cell().

Here is the call graph for this function:

◆ test_write_then_write_then_read_finds_the_real_read_past_the_superseding_write()

test_propagate_use_statements.test_write_then_write_then_read_finds_the_real_read_past_the_superseding_write ( )

A WRITE at N is immediately followed by another WRITE at N+1 - N's own search stops right there with nothing to do (superseded).

N+1 is itself a WRITE, though, so it is independently checked too, on its own terms: N+1 to the READ_AND_DISCARD at N+2 is distance 1 (odd), already fine.

Definition at line 106 of file test_propagate_use_statements.py.

References _chain_graph(), and _use_cell().

Here is the call graph for this function:

Variable Documentation

◆ READ_AND_DISCARD

test_propagate_use_statements.READ_AND_DISCARD = Task.DataAccess.READ_AND_DISCARD

Definition at line 11 of file test_propagate_use_statements.py.

◆ READ_AND_WRITE

test_propagate_use_statements.READ_AND_WRITE = Task.DataAccess.READ_AND_WRITE

Definition at line 13 of file test_propagate_use_statements.py.

◆ TEMPORARY

test_propagate_use_statements.TEMPORARY = Task.DataAccess.TEMPORARY

Definition at line 14 of file test_propagate_use_statements.py.

◆ WRITE

test_propagate_use_statements.WRITE = Task.DataAccess.WRITE

Definition at line 12 of file test_propagate_use_statements.py.