Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bf16f4b
ajflksjflkjflkajfklajjadsf
s-n-sharma Oct 29, 2025
64fbd2e
finished rudimentary qr solver
s-n-sharma Oct 31, 2025
aa72d75
rayon+openblas
s-n-sharma Nov 4, 2025
e754757
sparseQR
s-n-sharma Nov 6, 2025
e6a74da
decreased time by parallelization and fixing m < n case
s-n-sharma Nov 10, 2025
2b6a65e
removed some unused dependencies
s-n-sharma Nov 10, 2025
c8697d4
improved the building of the sparse matrices, removed dmatrix middleman
s-n-sharma Nov 11, 2025
0402e6b
refactor(solver): remove redundant temp variable for constraint IDs
GottaGetPaid Nov 11, 2025
bed1c7e
perf(solver): reduce usage of parallelism in small tasks
GottaGetPaid Nov 11, 2025
791716a
refactor(solver): remove unused free-var_idx variable
GottaGetPaid Nov 11, 2025
7b62baa
perf(solver): optimize triplet creation to take advantage of sparsity
GottaGetPaid Nov 11, 2025
26af3cb
perf(solver): reduce usage of parallelism in small tasks
GottaGetPaid Nov 12, 2025
140c5fe
Merge pull request #102 from ucb-substrate/sid-branch-2
s-n-sharma Nov 14, 2025
0a7b8cb
perf(solver): removed redundant construction of AT, improved SPQR struct
s-n-sharma Nov 15, 2025
1198a31
feat(solver): added free/determined variables checking
s-n-sharma Nov 15, 2025
1928e0a
Merge branch 'main' into solver-improvements
s-n-sharma Nov 18, 2025
e65b64d
perf(solver): improvements to nullspace computation, made it all sparse
s-n-sharma Nov 24, 2025
6795bda
perf(solver): improvements to nullspace computation, made it all sparse
s-n-sharma Nov 24, 2025
0e5f011
perf(solver): removed addition of zeroed variables to matrix
s-n-sharma Nov 24, 2025
8c95cf6
Merge branch 'main' into solver-improvements
s-n-sharma Nov 24, 2025
3d6d2ca
cleaned up some code
s-n-sharma Nov 25, 2025
62f8ae6
cleaning up
s-n-sharma Nov 27, 2025
1cf0825
cleaning up
s-n-sharma Nov 27, 2025
25c6f64
feat(solver): added rounding
s-n-sharma Nov 27, 2025
0f433e0
feat(solver): improved tests
s-n-sharma Jan 3, 2026
845a68e
feat(solver): numerical stability test
s-n-sharma Jan 4, 2026
4a04462
refactor(solver): removed unneeded stuff in build.rs
s-n-sharma Jan 4, 2026
edd79e0
Merge remote-tracking branch 'origin/main' into solver-improvements
s-n-sharma Jan 4, 2026
215d7ca
refactor(compiler): merging main
s-n-sharma Jan 4, 2026
8d68cca
refactor(solver): GDS in lib.rs for preparation to merge to main
s-n-sharma Jan 4, 2026
b3312d8
feat(solver): added support for windows
s-n-sharma Jan 4, 2026
3525499
chore: Update README
s-n-sharma Jan 4, 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
10 changes: 8 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,25 @@ Future versions of Argon will hopefully support:
To use Argon, you will need:
- [Rust (tested on 1.90.0)](https://www.rust-lang.org/tools/install)
- One of [Neovim (version 0.11.0 or above)](https://github.com/neovim/neovim/blob/master/INSTALL.md) or [VS Code (version 1.100.0 or above)](https://code.visualstudio.com/download)
- [SuiteSparse](https://github.com/DrTimothyAldenDavis/SuiteSparse)

### SuiteSparse Installation
#### macOS
If you use Homebrew, all you need is
```bash
brew install suitesparse
```
#### Windows/Linux
In this case, you will need to download SuiteSparse manually; you can use something like ``` conda ``` or ```vcpkg```. Then, locate the folder that contains the ```.h``` files, such as ```cholmod.h```, and the folder containing the ```.lib``` files (```.so``` or ```.a``` on Linux). Set the environment variables ```SUITESPARSE_INCLUDE_DIR``` and ```SUITESPARSE_LIB_DIR``` to the two paths you obtained from before, respectively.

### Argon Installation
Begin by cloning and compiling the Argon source code:

```bash
git clone https://github.com/ucb-substrate/argon.git
cd argon
cargo b --release
```

### Neovim

Add the following to your Neovim Lua configuration:
Expand Down
3 changes: 2 additions & 1 deletion core/compiler/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
build/

7 changes: 6 additions & 1 deletion core/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ edition = "2024"

[dependencies]
derive-where = { version = "1", features = ["serde"] }
nalgebra = "0.34"
nalgebra = { version = "0.34", features = ["rayon"] }
nalgebra-sparse = "0.11"
klayout-lyp = "0.1.1"
rayon = "1.10"
libc = "0.2"
rand = "0.8.5"
gds21 = "0.2"

anyhow = { workspace = true }
Expand All @@ -32,6 +36,7 @@ const_format = "0.2"

[build-dependencies]
lrpar = { version = "0.13", features = ["serde"] }
bindgen = "0.72.1"

cfgrammar = { workspace = true }
lrlex = { workspace = true }
48 changes: 48 additions & 0 deletions core/compiler/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::env;
use std::path::PathBuf;

use cfgrammar::yacc::YaccKind;
Expand Down Expand Up @@ -30,4 +31,51 @@ fn main() {
.mod_name("cell_l")
.build()
.unwrap();

println!("cargo:rerun-if-changed=wrapper.h");
println!("cargo:rerun-if-changed=build.rs");

println!("cargo:rerun-if-env-changed=SUITESPARSE_INCLUDE_DIR");
println!("cargo:rerun-if-env-changed=SUITESPARSE_LIB_DIR");

let include_dir =
env::var("SUITESPARSE_INCLUDE_DIR").unwrap_or_else(|_| "/opt/homebrew/include".to_string());
let lib_dir =
env::var("SUITESPARSE_LIB_DIR").unwrap_or_else(|_| "/opt/homebrew/lib".to_string());

println!("cargo:rustc-link-search=native={}", lib_dir);
println!("cargo:rustc-link-lib=spqr");
println!("cargo:rustc-link-lib=cholmod");
println!("cargo:rustc-link-lib=suitesparseconfig");
println!("cargo:rustc-link-lib=amd");
println!("cargo:rustc-link-lib=colamd");
println!("cargo:rustc-link-lib=ccolamd");
println!("cargo:rustc-link-lib=camd");

let bindings = bindgen::Builder::default()
.header("wrapper.h")
.clang_arg(format!("-I{}", include_dir))
.clang_arg(format!("-I{}/suitesparse", include_dir))
.wrap_unsafe_ops(true)
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.allowlist_function("SuiteSparseQR_C_QR")
.allowlist_function("cholmod_l_start")
.allowlist_function("cholmod_l_finish")
.allowlist_function("cholmod_l_free")
.allowlist_function("cholmod_l_free_sparse")
.allowlist_function("cholmod_l_free_dense")
.allowlist_function("cholmod_l_sparse_to_dense")
.allowlist_function("cholmod_l_allocate_triplet")
.allowlist_function("cholmod_l_free_triplet")
.allowlist_function("cholmod_l_triplet_to_sparse")
.allowlist_var("SPQR_ORDERING_DEFAULT")
.allowlist_var("SPQR_DEFAULT_TOL")
.allowlist_var("CHOLMOD_REAL")
.generate()
.expect("Unable to generate bindings");

let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("spqr_bindings.rs"))
.expect("Couldn't write bindings");
}
Loading