Repository navigation
51 lines (50 loc) · 2.08 KB
/
Copy pathstack-depth.yml
File metadata and controls
51 lines (50 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This workflow is managed by gh actions-lock.
# SPDX-License-Identifier: MPL-2.0
# This workflow is managed by gh actions-lock.
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
# Stack-depth budget guard for hyperpolymath/my-lang#37.
#
# #37 subtleties 1 & 3: the recursive AST `Drop` overflow, and the re-derivation
# of MAX_EXPR_DEPTH from a *measured* stack budget. That budget's binding
# constraint is the 1 MiB Windows main-thread stack, so the measurement has to
# be confirmed on the msvc toolchain — the single datapoint #37 was left open
# for ("leave #37 open until that datapoint confirms the 128 budget").
#
# This runs the self-driving measurement (examples/measure_depth.rs) and the
# regression test on BOTH ubuntu-latest and windows-latest. The example
# re-execs itself as worker subprocesses to find each overflow cliff, prints the
# per-platform bytes/level, and exits non-zero if MAX_EXPR_DEPTH no longer fits
# the 1 MiB floor with headroom — so the Windows datapoint is produced *and*
# locked in on every change instead of relying on a manual run.
name: Stack Depth (#37)
on:
push:
paths:
- 'crates/my-lang/**'
- '.github/workflows/stack-depth.yml'
pull_request:
paths:
- 'crates/my-lang/**'
- '.github/workflows/stack-depth.yml'
permissions: read-all
jobs:
measure:
name: measure (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Rust
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # stable
with:
toolchain: stable
- name: Stack-depth regression test (#37 subtleties 1 & 3)
run: cargo test -p my-lang --test stack_depth_37 --release -- --nocapture
- name: Measure stack budget and assert MAX_EXPR_DEPTH fits the 1 MiB floor
run: cargo run -p my-lang --example measure_depth --release