| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| GRB_TRY(GrB_eWiseAdd(P, GrB_NULL, GrB_NULL, GrB_LOR, P, next_frontier, GrB_NULL)); | ||
| GRB_TRY(GrB_Matrix_nvals(&states, next_frontier)); | ||
|
|
||
| if (iteration > 3000) |
There was a problem hiding this comment.
What?
Sorry, something went wrong.
| GRB_TRY(GrB_eWiseAdd(K, GrB_NULL, GrB_NULL, GrB_LOR, K, next_frontier, GrB_NULL)); | ||
| GRB_TRY(GrB_Matrix_nvals(&states, next_frontier)); | ||
|
|
||
| if (iteration > 3000) |
There was a problem hiding this comment.
What?
Sorry, something went wrong.
Matrix reshape from |V|*|V| to 1*|V*V| triggered 32-bit indexing overflow when V*V > 2^32. The library correctly detects potential overflow (Cj_is_32=false), but the in-place reshape operation (in_place=true) inherits T->j_is_32=true from the original matrix, causing J_work_is_32 to become true and overflow to occur. Solution: use matrix_reshape_dup instead of matrix_reshape to create a new matrix (in_place=false), so J_work_is_32 correctly evaluates to false and 64-bit indexing is used.
CFPQ_RSM Benchmark ReportOverviewThis is a comparative evaluation that focuses on the multiple-sources reachability scenario, where the number of source vertices is significantly smaller that the total number of graph vertices. Experimental Setup
Experiment 1: Nested Parentheses GrammarGrammarGraphs
Time Results (avg_time_ms)
Memory Results (avg_max_memory_kb)
Time Speedup (All-Pairs / CFPQ_RSM)
Memory Speedup (All-Pairs / CFPQ_RSM)
Time Speedup (CFL_multsrc / CFL_CFPQ_RSM)
Memory Speedup (CFL_multsrc / CFL_CFPQ_RSM)
Experiment 2: Java Points-To Analysis GrammarGrammarGraphs
Time Results (avg_time_ms)
Memory Results (avg_max_memory_kb)
Time Speedup (All-Pairs / CFPQ_RSM)
Memory Speedup (All-Pairs / CFPQ_RSM)
Time Speedup (CFL_multsrc / CFL_CFPQ_RSM)
Memory Speedup (CFL_multsrc / CFL_CFPQ_RSM)
Experiment 3: C Alias Analysis GrammarGrammarGraphs
Time Results (avg_time_ms)
Memory Results (avg_max_memory_kb)
Time Speedup (All-Pairs / CFPQ_RSM)
Memory Speedup (All-Pairs / CFPQ_RSM)
Time Speedup (CFL_multsrc / CFL_CFPQ_RSM)
Memory Speedup (CFL_multsrc / CFL_CFPQ_RSM)
|
Sorry, something went wrong.
|
Algorithm CFPQ_RSM(rsm, graph, start_nonterm, start_vertex) Input:
Output:
// ------------------- INITIALIZATION -------------------
P := zero matrix of size Q x V^2 // Visited configurations
M := zero matrix of size Q x V^2 // Current frontier
for each nonterminal i do
graph_nt[i] := zero matrix of size V x V
// Seed initial frontier and visited
q_start = start_states[start_nonterm]
for each start_vertex in sources do
diag_col := start_vertex * V + start_vertex
M[q, diag_col] := true
P[q, diag_col] := true
// ------------------- MAIN FIXED-POINT LOOP -------------------
while M is not empty do
// Phase 1: TERMINAL TRANSITIONS
M_term := zero matrix Q x V^2
for each terminal a do
M_term |= rsm_term[a]^T @ M @ graph_term[a]
// Phase 2: NONTERMINAL TRANSITIONS
M_nonterm := zero matrix Q x V^2
for each nonterminal i do
M_nonterm |= rsm_nonterm[i] @ M @ graph_nt[i]
// Phase 3: CALL TRANSITIONS
M_call := zero matrix Q x V^2
for each nonterminal i do
mask_call := rsm.call[i]^T @ M
mask_call := reshape(mask_call, Q*V x V)
entry_vec := column_OR(mask_call) // Boolean vector of size V
diag_entry := diag(entry_vec) // VxV
diag_entry := reshape(diag_entry, 1 x V^2)
outer_result := rsm_start[i] @ diag_entry // |Q|x1 @ 1x|V^2| -> |Q|x|V^2|
M_call |= outer_result
// Phase 4: RETURN TRANSITIONS
M_return := zero matrix Q x V^2
for each nonterminal i do
// Collect new completed edges for this nonterminal
new_edges := final_states[i] @ M // 1x|Q| @ |Q|x|V^2| -> 1x|V^2|
new_edges := reshape(new_edges, V x V)
graph_nt[i] |= new_edges
// Restore callers from stack and advance them
M_return |= rsm_nonterm[i]^T @ P @ new_edges
// Phase 5: MERGE & MARK VISITED
M_new := (M_term | M_nonterm | M_call | M_return) & ~P
P |= M_new
M := M_new
end while
// ------------------- RESULT -------------------
return row start_vertex of graph_nt[start_nonterm]
|
Sorry, something went wrong.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This patch implements a context-free path query algorithm using recursive state machines (RSMs) over edge-labeled directed graphs. It extends the approach of the previously unified regular path search algorithm by using linear algebra operations on adjacency matrices, as presented in https://arxiv.org/abs/2412.10287.