Skip to content

Commit b7692b3

Browse files
ci: Fix errors (#461)
* ci: Fix Zisk execute * ci: enforce --wfail across all lean targets; fix String.dropRight deprecation lean-test now compiles everything with warnings-as-errors: - lean-action builds the default target with --wfail (warms cache, checks lib) - `lake lint -- --wfail -v` runs the @[lint_driver] build-all script, building every lib/exe target (exes, benchmarks, Apps) under --wfail - both `lake test` steps run with --wfail Replace deprecated `String.dropRight` with `String.dropEnd` in ProfileCmd and ShardCmd — the deprecation these strict builds now catch.
1 parent 4b0af6c commit b7692b3

4 files changed

Lines changed: 32 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ jobs:
2222
- uses: leanprover/lean-action@v1
2323
with:
2424
build-args: "--wfail -v"
25+
# build-all lint driver compiles every lib/exe target with --wfail, so a
26+
# warning in any target (exes, benchmarks, Apps) — not just the default lib
27+
# lean-action builds above — fails CI.
28+
- name: Build all targets
29+
run: lake lint -- --wfail -v
2530
- name: Test Ix CLI
26-
run: lake test -- cli
31+
run: lake test --wfail -- cli
2732
- name: Aiur tests
28-
run: lake test -- --ignored aiur aiur-hashes ixvm multi-stark recursive-verifier
33+
run: lake test --wfail -- --ignored aiur aiur-hashes ixvm multi-stark recursive-verifier
2934
- name: Check Lean versions match for Ix and compiler bench
3035
run: diff lean-toolchain Benchmarks/Compile/lean-toolchain
3136

Ix/Cli/ProfileCmd.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def runProfileCmd (p : Cli.Parsed) : IO UInt32 := do
3232
-- Default sidecar mirrors the env's base name: `init.ixe` → `init.ixprof`
3333
-- (not `init.ixe.ixprof`); a non-`.ixe` path just gets `.ixprof` appended.
3434
| none =>
35-
let base := if envPath.endsWith ".ixe" then envPath.dropRight 4 else envPath
35+
let base := if envPath.endsWith ".ixe" then (envPath.dropEnd 4).toString else envPath
3636
base ++ ".ixprof"
3737
let isolate := !(p.flag? "keep-caches" |>.isSome)
3838
let quiet := !(p.flag? "verbose" |>.isSome)

Ix/Cli/ShardCmd.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def runShardCmd (p : Cli.Parsed) : IO UInt32 := do
4040
-- Default manifest mirrors the profile's base name: `init.ixprof` →
4141
-- `init.ixes` (not `init.ixprof.ixes`).
4242
| none =>
43-
let base := if espPath.endsWith ".ixprof" then espPath.dropRight 7 else espPath
43+
let base := if espPath.endsWith ".ixprof" then (espPath.dropEnd 7).toString else espPath
4444
base ++ ".ixes"
4545
let shardsFlag : Option Nat := (p.flag? "shards").map (·.as! Nat)
4646
let maxCycles : Option Nat := (p.flag? "max-cycles").map (·.as! Nat)

crates/kernel/src/ingress.rs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,6 +3424,7 @@ impl IngressStreamTimingSnapshot {
34243424
}
34253425
}
34263426

3427+
#[cfg(not(target_arch = "riscv64"))]
34273428
#[derive(Default)]
34283429
struct IxonDropTiming {
34293430
consts_ns: u64,
@@ -3433,6 +3434,7 @@ struct IxonDropTiming {
34333434
comms_ns: u64,
34343435
}
34353436

3437+
#[cfg(not(target_arch = "riscv64"))]
34363438
struct LookupDropTiming {
34373439
names_ns: u64,
34383440
name_to_addr_ns: u64,
@@ -3446,16 +3448,19 @@ fn elapsed_ns(start: Instant) -> u64 {
34463448
duration_ns(start.elapsed())
34473449
}
34483450

3451+
#[cfg(not(target_arch = "riscv64"))]
34493452
#[allow(clippy::cast_precision_loss)]
34503453
fn seconds(ns: u64) -> f64 {
34513454
ns as f64 / 1_000_000_000.0
34523455
}
34533456

3457+
#[cfg(not(target_arch = "riscv64"))]
34543458
#[allow(clippy::cast_precision_loss)]
34553459
fn percent(part: u64, total: u64) -> f64 {
34563460
if total == 0 { 0.0 } else { (part as f64 * 100.0) / total as f64 }
34573461
}
34583462

3463+
#[cfg(not(target_arch = "riscv64"))]
34593464
fn timed_drop_ns<T>(value: T) -> u64 {
34603465
let start = Instant::now();
34613466
drop(value);
@@ -3584,7 +3589,10 @@ fn insert_standalone_entries<M: KernelMode>(
35843589
zenv: &mut KEnv<M>,
35853590
entries: Vec<(KId<M>, KConst<M>)>,
35863591
) -> IngressInsertTiming {
3592+
#[cfg(not(target_arch = "riscv64"))]
35873593
let mut timing = IngressInsertTiming::default();
3594+
#[cfg(target_arch = "riscv64")]
3595+
let timing = IngressInsertTiming::default();
35883596

35893597
#[cfg(not(target_arch = "riscv64"))]
35903598
let phase_start = Instant::now();
@@ -3613,7 +3621,10 @@ fn insert_muts_entries<M: KernelMode>(
36133621
zenv: &mut KEnv<M>,
36143622
entries: Vec<(KId<M>, KConst<M>)>,
36153623
) -> IngressInsertTiming {
3624+
#[cfg(not(target_arch = "riscv64"))]
36163625
let mut timing = IngressInsertTiming::default();
3626+
#[cfg(target_arch = "riscv64")]
3627+
let timing = IngressInsertTiming::default();
36173628

36183629
#[cfg(not(target_arch = "riscv64"))]
36193630
let phase_start = Instant::now();
@@ -3787,15 +3798,12 @@ fn ixon_ingress_inner<M: KernelMode>(
37873798
#[cfg(not(target_arch = "riscv64"))]
37883799
let phase_start = Instant::now();
37893800
let mut work_items: Vec<IngressWorkItem> = Vec::new();
3790-
let mut standalone_count = 0usize;
3791-
let mut muts_count = 0usize;
37923801

37933802
for entry in ixon_env.named.iter() {
37943803
let const_name = entry.key().clone();
37953804
let named = entry.value();
37963805
match &named.meta.info {
37973806
ConstantMetaInfo::Muts { .. } => {
3798-
muts_count += 1;
37993807
work_items.push(IngressWorkItem::Muts(const_name));
38003808
},
38013809
ConstantMetaInfo::Indc { .. }
@@ -3808,7 +3816,6 @@ fn ixon_ingress_inner<M: KernelMode>(
38083816
| IxonCI::RPrj(_)
38093817
| IxonCI::DPrj(_) => {},
38103818
_ => {
3811-
standalone_count += 1;
38123819
work_items.push(IngressWorkItem::Standalone(const_name));
38133820
},
38143821
}
@@ -3819,25 +3826,29 @@ fn ixon_ingress_inner<M: KernelMode>(
38193826
match &c.info {
38203827
IxonCI::DPrj(_) => {},
38213828
_ => {
3822-
standalone_count += 1;
38233829
work_items.push(IngressWorkItem::Standalone(const_name));
38243830
},
38253831
}
38263832
}
38273833
},
38283834
_ => {
3829-
standalone_count += 1;
38303835
work_items.push(IngressWorkItem::Standalone(const_name));
38313836
},
38323837
}
38333838
}
38343839
#[cfg(not(target_arch = "riscv64"))]
3835-
log::info!(
3836-
"[ixon_ingress] partition work: {:.2}s ({} standalone, {} muts)",
3837-
phase_start.elapsed().as_secs_f32(),
3838-
standalone_count,
3839-
muts_count
3840-
);
3840+
{
3841+
let muts_count = work_items
3842+
.iter()
3843+
.filter(|w| matches!(w, IngressWorkItem::Muts(_)))
3844+
.count();
3845+
log::info!(
3846+
"[ixon_ingress] partition work: {:.2}s ({} standalone, {} muts)",
3847+
phase_start.elapsed().as_secs_f32(),
3848+
work_items.len() - muts_count,
3849+
muts_count
3850+
);
3851+
}
38413852

38423853
// Convert each standalone constant or Muts block sequentially into the
38433854
// single-threaded KEnv.

0 commit comments

Comments
 (0)