Skip to content

Commit ce0f363

Browse files
committed
128
1 parent 32a3a88 commit ce0f363

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/app/src/routes/app/(canvas)/spanner/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
const graph = await loadGraph(selectedGraph);
3838
3939
greedy = new GreedySpanner({ graph, device, maxDistortion: 2 });
40-
theta = new ThetaSpanner({ graph, device, maxDistortion: 3 });
40+
theta = new ThetaSpanner({ graph, device, maxDistortion: 128 });
4141
4242
runGPU();
4343
});

packages/core/src/spanner/theta/gpu.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ export class ThetaSpanner extends Spanner {
194194
spanner.addEdge({ start, end, weight });
195195
}
196196

197-
// spanner.edges.forEach((edge) => {
198-
// if (!this.#graph.edges.has(`${edge.start}_${edge.end}`)) {
199-
// spanner.removeEdge(edge);
200-
// }
201-
// });
197+
spanner.edges.forEach((edge) => {
198+
if (!this.#graph.edges.has(`${edge.start}_${edge.end}`)) {
199+
spanner.removeEdge(edge);
200+
}
201+
});
202202

203203
this.#counterReadBuffer.unmap();
204204
this.#edgesReadBuffer.unmap();

packages/core/src/spanner/theta/shader.wgsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct Uniforms {
2121

2222
const TILE: u32 = 64u;
2323
const PI: f32 = 3.141592653589793;
24-
const K : u32 = 128;
24+
const K: u32 = 128;
2525

2626
var<workgroup> shPos : array<Position, TILE>;
2727
var<workgroup> shIdx : array<u32, TILE>;
@@ -38,7 +38,7 @@ fn compute(
3838
// best candidate per cone
3939
var bestDist : array<f32, K>;
4040
var bestIdx : array<u32, K>;
41-
for (var c : u32 = 0u; c < uniforms.k; c = c + 1u) {
41+
for (var c : u32 = 0u; c < K; c = c + 1u) {
4242
bestDist[c] = 1e30;
4343
bestIdx[c] = 0xffffffffu;
4444
}
@@ -79,7 +79,7 @@ fn compute(
7979
}
8080

8181
// write chosen edges (de-duplicate undirected)
82-
for (var c : u32 = 0u; c < uniforms.k; c = c + 1u) {
82+
for (var c : u32 = 0u; c < K; c = c + 1u) {
8383
let j = bestIdx[c];
8484
if (j != 0xffffffffu && i < j) {
8585
if (i < uniforms.node_count) {

0 commit comments

Comments
 (0)