Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a4404c3
Reorganize ECO: Move C++ GED implementation from mcs_ged/ to eco/
alirezazd Feb 9, 2026
3fc6772
ECO: Organize third-party libraries into subdirectories
alirezazd Feb 9, 2026
a2e1ed9
ECO/GED: Add core graph data structures
alirezazd Feb 9, 2026
ff87ed7
ECO/GED: Add linear assignment problem solver
alirezazd Feb 9, 2026
2beb4b4
ECO/GED: Implement graph edit distance algorithm
alirezazd Feb 9, 2026
76c55a4
ECO: Update BUILD with GED/MCS targets
alirezazd Feb 9, 2026
dd9229a
ECO/GED: Add maximum common subgraph preprocessing
alirezazd Feb 9, 2026
047cb2a
ECO/GED: Add command-line tool for graph edit distance
alirezazd Feb 9, 2026
f7d0570
ECO: Integrate GED with IR patching system
alirezazd Feb 9, 2026
a7106ec
ECO: Add build rules and integration tests
alirezazd Feb 9, 2026
6ba8e06
ECO: Fix build issues after rebase onto upstream/main
alirezazd Feb 9, 2026
999d63c
ECO: Merge upstream Python tools with deprecation notices
alirezazd Feb 9, 2026
bb1fe2b
ECO: Modernize diff and patch pipeline
alirezazd Feb 28, 2026
c0e6ea8
ECO: Update deprecation notice for GXL export tool
alirezazd Feb 28, 2026
75cbf3e
ECO: Update flag description for equivalence report path to match the…
alirezazd Feb 28, 2026
50c4e81
ECO: Enable execution stats report by default in xls_dslx_ir_diff_rule
alirezazd Feb 28, 2026
58e61c5
ECO: Update include paths and clean up code formatting across multipl…
alirezazd Mar 3, 2026
0d95a0b
ECO: Fixed edge matching logic and introduce PopulateMatchedEdges fu…
alirezazd Mar 3, 2026
17b40f5
ECO: switch report flags to path outputs and simplify ECO build tooling
alirezazd Mar 6, 2026
af31458
ECO: Bug Fixes
alirezazd Mar 6, 2026
3f07a58
ECO: Refactor MCS solver to use SearchContext struct and improve cand…
alirezazd Mar 15, 2026
cde6b87
ECO: Restore comments to clarify mcs_cutoff parameter in SolveMCS fun…
alirezazd Mar 15, 2026
df47750
[eco] refine MCS matching logic and add coverage
alirezazd Mar 25, 2026
56f3587
ECO: Remove outdated comments from testing hooks in mcs.h
alirezazd Mar 25, 2026
f0c838f
ECO: Update dependencies and refactor sorting to use Abseil algorithms
alirezazd Apr 13, 2026
4be2ec5
ECO: Move xls/eco to xls/contrib/eco
alirezazd Apr 13, 2026
63e80b8
Moved tinyxml to BCR
alirezazd May 5, 2026
885da65
feat: Enhance ECO with new attributes and graph conversion
alirezazd May 5, 2026
9a9c528
Refactor cost attributes in XLS graph representation
alirezazd May 5, 2026
e9ddcf5
refactor: Adjust namespace usage and improve code clarity in codegen_…
alirezazd May 5, 2026
bc800bc
ECO: Remove Python implementation, add README, style cleanup
alirezazd May 28, 2026
9f576d1
ECO: Use common Stopwatch for timing; tidy logging, namespacing, TODOs
alirezazd Jun 10, 2026
02bcab0
ECO: Use Stopwatch::GetElapsedTime() instead of manual time subtraction
alirezazd Jun 10, 2026
e93fa11
ECO: Migrate BUILD to bzlmod repo names
alirezazd Sep 1, 2026
edf4290
ECO: Catch up with upstream PipelineSchedule, InsertStateElement and …
alirezazd Sep 2, 2026
2a63d73
ECO: Look up state read by IR node name in xls_ir_to_graph_test
alirezazd Sep 1, 2026
2a2a053
ECO: Use int64_t instead of long in ged_main
alirezazd Oct 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ECO: Update include paths and clean up code formatting across multipl…
…e files
  • Loading branch information
alirezazd committed Oct 10, 2026
commit 58e61c587f603d41df45f4ebb1f1c714a3da3292
2 changes: 1 addition & 1 deletion xls/eco/ged.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "ged.h"
#include "xls/eco/ged.h"

#include <algorithm>
#include <chrono>
Expand Down
11 changes: 1 addition & 10 deletions xls/eco/ged.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <utility>
#include <vector>

#include "graph.h"
#include "xls/eco/graph.h"

namespace ged {

Expand Down Expand Up @@ -134,15 +134,6 @@ struct GEDResult {
int total_cost = INT_MAX;
};

struct SearchState;

void GetEditPaths(SearchState& state, CostMatrix& Cv, CostMatrix& Ce,
const XLSGraph& G1, const XLSGraph& G2,
std::function<bool(int64_t)> prune, int& maxcost_value,
int& best_cost, GEDResult& best_result, int& expansion_count,
std::vector<std::vector<double>>& dense_Cv_buffer,
std::vector<std::vector<double>>& dense_Ce_buffer);

GEDResult SolveGED(const XLSGraph& graph1, const XLSGraph& graph2,
const GEDOptions& options);

Expand Down
2 changes: 1 addition & 1 deletion xls/eco/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct XLSGraph
absl::flat_hash_map<std::pair<int, int>, int, PairHash> edge_counts;
absl::flat_hash_map<std::string, int> node_name_to_index;
std::optional<std::string> return_node_name;

// Mapping between current indices and original indices after cutting
std::vector<int> original_indices; // current_index -> original_index
absl::flat_hash_map<int, int> current_indices; // original_index -> current_index
Expand Down
2 changes: 1 addition & 1 deletion xls/eco/gxl_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define XLS_ECO_GXL_PARSER_H_

#include "xls/eco/graph.h"
#include "tinyxml2.h"
#include "xls/eco/libs/tinyxml2/tinyxml2.h"
#include <iostream>
#include <map>
#include <sstream>
Expand Down
11 changes: 5 additions & 6 deletions xls/eco/ir2gxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
# - Integration with C++ GED implementation
# Please migrate to using the C++ GXL tools in //xls/eco.

import sys
import os
from pathlib import Path


"""IR to GXL conversion library for XLS ECO.

This module provides functionality to convert XLS IR files to GXL format
Expand All @@ -33,12 +38,6 @@
the same IR graph construction logic.
"""

import sys
import os
from pathlib import Path
from typing import Optional
import networkx as nx

# Add the parent directory to the path so we can import the modules
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

Expand Down
2 changes: 1 addition & 1 deletion xls/eco/ir_patch.proto
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ message IrPatchProto {
repeated EditPathProto edit_paths = 1;
string function_name = 2;
optional NodeProto return_node = 3;
}
}
27 changes: 13 additions & 14 deletions xls/eco/mcs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#include <cmath>
#include <limits>
#include <string>
#include "absl/container/flat_hash_set.h"

#include "absl/container/flat_hash_set.h"
#include "absl/log/log.h"

/* Implementation of the Maximum Common Subgraph (MCS) algorithm based on the work:
Kaiqiang Yu, Kaixin Wang, Cheng Long, Laks Lakshmanan, and Reynold Cheng.
/* Implementation of the Maximum Common Subgraph (MCS) algorithm based on the
work: Kaiqiang Yu, Kaixin Wang, Cheng Long, Laks Lakshmanan, and Reynold Cheng.
"Fast Maximum Common Subgraph Search: A Redundancy-Reduced Backtracking
Approach." Proc. ACM Manag. Data 3, 3, Article 160 (2025).
https://doi.org/10.1145/3725404 */
Expand Down Expand Up @@ -207,7 +207,7 @@ void RRSplitRec(State& S, const CandidateSet& C, const ForbiddenSet& D,
S_best = S;
g_best_size = (int)S.size();
VLOG(2) << indent(depth) << "[best] improved best_size=" << g_best_size;

// Check cutoff: stop if remaining unmatched nodes <= cutoff threshold
if (g_mcs_cutoff >= 0) {
int remaining = g_total_nodes - g_best_size;
Expand All @@ -218,7 +218,7 @@ void RRSplitRec(State& S, const CandidateSet& C, const ForbiddenSet& D,
return;
}
}

if (g_best_size == (int)Q.nodes.size()) {
g_stop = true;
VLOG(2) << indent(depth)
Expand Down Expand Up @@ -347,8 +347,7 @@ MCSResult SolveMCS(const XLSGraph& graph1, const XLSGraph& graph2,
VLOG(0) << "MCS start: G1 nodes=" << graph1.nodes.size()
<< " edges=" << graph1.edges.size()
<< " | G2 nodes=" << graph2.nodes.size()
<< " edges=" << graph2.edges.size()
<< " | cutoff=" << mcs_cutoff;
<< " edges=" << graph2.edges.size() << " | cutoff=" << mcs_cutoff;

g_stop = false;
g_best_size = 0;
Expand All @@ -361,9 +360,8 @@ MCSResult SolveMCS(const XLSGraph& graph1, const XLSGraph& graph2,
// Check cutoff condition before starting search
int total_nodes = graph1.nodes.size();
if (mcs_cutoff >= 0 && total_nodes <= mcs_cutoff) {
VLOG(0) << "MCS cutoff: total nodes (" << total_nodes
<< ") <= cutoff (" << mcs_cutoff
<< "), skipping MCS (will use GED for all nodes)";
VLOG(0) << "MCS cutoff: total nodes (" << total_nodes << ") <= cutoff ("
<< mcs_cutoff << "), skipping MCS (will use GED for all nodes)";
MCSResult empty_result;
empty_result.size = 0;
for (int i = 0; i < total_nodes; ++i) {
Expand All @@ -385,8 +383,9 @@ MCSResult SolveMCS(const XLSGraph& graph1, const XLSGraph& graph2,
// Check if cutoff threshold is met
int remaining_nodes = total_nodes - result.size;
if (mcs_cutoff >= 0 && remaining_nodes <= mcs_cutoff) {
VLOG(0) << "MCS cutoff reached: remaining unmatched nodes (" << remaining_nodes
<< ") <= cutoff (" << mcs_cutoff << "), stopping MCS early";
VLOG(0) << "MCS cutoff reached: remaining unmatched nodes ("
<< remaining_nodes << ") <= cutoff (" << mcs_cutoff
<< "), stopping MCS early";
}

VLOG(1) << "MCS found with " << result.size << " matched nodes";
Expand Down Expand Up @@ -423,8 +422,8 @@ MCSResult SolveMCS(const XLSGraph& graph1, const XLSGraph& graph2,
return result;
}
absl::flat_hash_map<int, int> GetBoundaryNodes(const MCSResult& mcs,
const XLSGraph& graph1,
const XLSGraph& graph2) {
const XLSGraph& graph1,
const XLSGraph& graph2) {
absl::flat_hash_map<int, int> boundary_nodes;
if (mcs.mapping.empty()) return boundary_nodes;

Expand Down
2 changes: 1 addition & 1 deletion xls/eco/test/apfloat_fmac.org.x
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ pub proc fmac {
send(tok3, output, acc);
acc
}
}
}
2 changes: 1 addition & 1 deletion xls/eco/test/fir_filter_fp32.rev.x
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ pub fn fir_filter_float32<NUM_TAPS:u32, NUM_SAMPLES:u32,

pub fn main(samples: F32[6], coefficients: F32[4]) -> F32[3] {
fir_filter_float32(samples, coefficients)
}
}
1 change: 0 additions & 1 deletion xls/eco/test/histogram.rev.x
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,3 @@ pub proc histogram {
(final_num_bins, final_min_value, final_max_value, updated_histogram)
}
}