Skip to content

Commit 3fc55d3

Browse files
committed
fix: ci build
1 parent 8f8a9f7 commit 3fc55d3

File tree

25 files changed

+90
-102
lines changed

25 files changed

+90
-102
lines changed

.github/dart.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ sudo ln -sf $PWD/dart-sdk/bin/dart /usr/local/bin/dart
99
popd
1010

1111
# dart3
12-
mkdir dart3sdk
13-
pushd dart3sdk
14-
wget https://storage.googleapis.com/dart-archive/channels/dev/release/latest/sdk/dartsdk-linux-x64-release.zip -O dartsdk.zip
15-
unzip -o dartsdk.zip
16-
sudo ln -sf $PWD/dart-sdk/bin/dart /usr/local/bin/dart3
17-
popd
18-
popd
19-
dart --version
20-
dart3 --version
12+
# mkdir dart3sdk
13+
# pushd dart3sdk
14+
# wget https://storage.googleapis.com/dart-archive/channels/dev/release/latest/sdk/dartsdk-linux-x64-release.zip -O dartsdk.zip
15+
# unzip -o dartsdk.zip
16+
# sudo ln -sf $PWD/dart-sdk/bin/dart /usr/local/bin/dart3
17+
# popd
18+
# popd
19+
# dart --version
20+
# dart3 --version

.github/odin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/sh
22

3-
VERSION=dev-2023-04
3+
VERSION=dev-2023-07
44
FILE_NAME=odin-ubuntu-amd64-$VERSION.zip
55
sudo apt-get install -y aria2
66
mkdir /tmp/odin

.github/workflows/bench.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: bench
2+
concurrency:
3+
group: ${{ github.workflow }}-${{ github.ref }}
4+
cancel-in-progress: true
25
on:
36
push:
47
branches: [main]
58
pull_request:
69
branches: [main]
710
workflow_dispatch:
11+
merge_group:
812
schedule:
913
- cron: "0 0 1 * *"
1014
env:

.github/workflows/cancel-stale.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/site.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
name: site
2-
2+
concurrency:
3+
group: ${{ github.workflow }}-${{ github.ref }}
4+
cancel-in-progress: true
35
on:
46
# push:
57
# branches: [main]
68
pull_request:
79
branches: [main]
810
workflow_dispatch:
11+
merge_group:
912
jobs:
1013
build:
1114
runs-on: ${{ matrix.os }}

bench/algorithm/binarytrees/1.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const global_allocator = std.heap.c_allocator;
99
pub fn main() !void {
1010
const stdout = std.io.getStdOut().writer();
1111
const n = try get_n();
12-
const max_depth = math.max(MIN_DEPTH + 2, n);
12+
const max_depth = @max(MIN_DEPTH + 2, n);
1313
{
1414
const stretch_depth = max_depth + 1;
1515
const stretch_tree = Node.make(stretch_depth, global_allocator).?;
@@ -21,7 +21,7 @@ pub fn main() !void {
2121

2222
var depth: usize = MIN_DEPTH;
2323
while (depth <= max_depth) : (depth += 2) {
24-
const iterations = @intCast(usize, 1) << @intCast(u6, max_depth - depth + MIN_DEPTH);
24+
const iterations = @as(usize, 1) << @as(u6, @intCast(max_depth - depth + MIN_DEPTH));
2525
var sum: usize = 0;
2626
var i: usize = 0;
2727
while (i < iterations) : (i += 1) {

bench/algorithm/edigits/1.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ pub fn main() !void {
2828
defer a.deinit();
2929
var ten = try bigint.Managed.initSet(global_allocator, 10);
3030
defer ten.deinit();
31-
try bigint.Managed.pow(&a, &ten, @bitCast(u32, n - 1));
31+
try bigint.Managed.pow(&a, &ten, @as(u32, @bitCast(n - 1)));
3232
var tmp = try bigint.Managed.init(global_allocator);
3333
defer tmp.deinit();
3434
try bigint.Managed.mul(&tmp, &answer, &a);
3535
try bigint.Managed.divFloor(&answer, &a, &tmp, &q);
3636
var str = try answer.toString(global_allocator, 10, std.fmt.Case.lower);
3737
var i: usize = 0;
38-
var n_usize = @as(usize, @bitCast(u32, n));
38+
var n_usize = @as(usize, @as(u32, @bitCast(n)));
3939
while (i < n_usize) {
4040
var sb = [10:0]u8{ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
4141
var j: usize = i;
@@ -99,8 +99,8 @@ fn test_k(n: i32, k: i32) bool {
9999
if (k < 0) {
100100
return false;
101101
}
102-
var float_k = @intToFloat(f64, k);
103-
var float_n = @intToFloat(f64, n);
102+
var float_k: f64 = @floatFromInt(k);
103+
var float_n: f64 = @floatFromInt(n);
104104
var ln_k_factorial = float_k * (math.ln(float_k) - 1.0) + 0.5 * math.ln(math.tau);
105105
var log_10_k_factorial = ln_k_factorial / math.ln10;
106106
return log_10_k_factorial >= float_n + 50.0;

bench/algorithm/fannkuch-redux/1.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ pub fn main() !void {
5151
flips_count += 1;
5252
}
5353

54-
max_flips_count = std.math.max(max_flips_count, flips_count);
54+
max_flips_count = @max(max_flips_count, flips_count);
5555
if (perm_count % 2 == 0) {
56-
checksum += @intCast(isize, flips_count);
56+
checksum += @intCast(flips_count);
5757
} else {
58-
checksum -= @intCast(isize, flips_count);
58+
checksum -= @intCast(flips_count);
5959
}
6060

6161
while (true) : (r += 1) {

bench/algorithm/fannkuch-redux/2-m.zig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const std = @import("std");
22

33
const max_n = 12;
4-
const Vec = std.meta.Vector(max_n, u8);
4+
const Vec = @Vector(max_n, u8);
55

66
fn runInParallel(tasks: []std.Thread, len: usize, comptime f: anytype, args: anytype) !void {
77
const len_per_task = @divTrunc(len, tasks.len + 1);
@@ -73,7 +73,7 @@ fn countAtPos(n: u8, start: usize) [max_n]u8 {
7373
while (i > 0) {
7474
i -= 1;
7575
const total_perms = factorialComptime(i);
76-
count[i] = i + 1 - @intCast(u8, r / total_perms);
76+
count[i] = i + 1 - @as(u8, @intCast(r / total_perms));
7777
r %= total_perms;
7878
}
7979
return count;
@@ -94,11 +94,11 @@ const Stats = struct {
9494

9595
fn nextPermutation(perm: Vec, count: []u8) ?Vec {
9696
const r = for (count, 0..) |v, i| {
97-
if (v != 1) break @intCast(u8, i);
97+
if (v != 1) break @as(u8, @intCast(i));
9898
} else return null;
9999
const next_perm = applyMask(perm, r + 1, nextPermMask);
100100
count[r] -= 1;
101-
for (count[0..r], 0..) |*v, i| v.* = @intCast(u8, i + 1);
101+
for (count[0..r], 0..) |*v, i| v.* = @intCast(i + 1);
102102
return next_perm;
103103
}
104104

@@ -109,9 +109,9 @@ fn pfannkuchenStats(first: usize, last: usize, n: u8, res: *Stats) void {
109109
var i = first;
110110
while (i < last) : (i += 1) {
111111
const flips = pfannkuchen(perm);
112-
const parity = 1 - @intCast(i32, i % 2) * 2;
113-
stats.max_flips = std.math.max(stats.max_flips, flips);
114-
stats.checksum += @intCast(i32, flips) * parity;
112+
const parity = 1 - @as(i32, @intCast(i % 2)) * 2;
113+
stats.max_flips = @max(stats.max_flips, flips);
114+
stats.checksum += @as(i32, @intCast(flips)) * parity;
115115
perm = nextPermutation(perm, count[0..n]) orelse break;
116116
}
117117
_ = @atomicRmw(u32, &res.max_flips, .Max, stats.max_flips, .SeqCst);

bench/algorithm/fannkuch-redux/2.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const std = @import("std");
22

3-
const Vec = std.meta.Vector(16, u8);
3+
const Vec = @Vector(16, u8);
44

55
fn reverse_mask(n: u8) Vec {
66
// global constant is not used to workaround a compiler bug
@@ -52,14 +52,14 @@ pub fn main() !void {
5252
var parity: u1 = 0;
5353
while (true) : (parity +%= 1) {
5454
const flip_count = pfannkuchen(perm);
55-
max_flip_count = std.math.max(max_flip_count, flip_count);
56-
checksum += @intCast(i32, flip_count) * (1 - @intCast(i32, parity) * 2);
55+
max_flip_count = @max(max_flip_count, flip_count);
56+
checksum += @as(i32, @intCast(flip_count)) * (1 - @as(i32, @intCast(parity)) * 2);
5757
const r = for (count[0..n], 0..) |v, i| {
58-
if (v != 1) break @intCast(u8, i);
58+
if (v != 1) break @as(u8, @intCast(i));
5959
} else break;
6060
perm = apply_mask(perm, r + 1, next_perm_mask);
6161
count[r] -= 1;
62-
for (count[1..r], 0..) |*v, i| v.* = @intCast(u8, i + 2);
62+
for (count[1..r], 0..) |*v, i| v.* = @intCast(i + 2);
6363
}
6464

6565
const stdout = std.io.getStdOut().writer();

0 commit comments

Comments
 (0)