Compare commits

...
Author SHA1 Message Date
dependabot[bot] 67de44a803 ci(deps): bump step-security/harden-runner
Bumps the actions group with 1 update in the / directory: [step-security/harden-runner](https://github.com/step-security/harden-runner).


Updates `step-security/harden-runner` from 2.22.4 to 2.23.0
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](https://github.com/step-security/harden-runner/compare/v2.22.4...v2.23.0)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-12-03 11:06:52 +00:00
FredApps 577ada30b4 Merge pull request #2585 from storytold/fix/ppt-run-scaling-test-freebsd
Tests: the many-runs import test compares two sizes instead of timing one against 20 s
2026-12-03 02:05:32 +01:00
FredApps 75c29c27db Tests: the many-runs import test compares two sizes instead of timing one against 20 s
On FreeBSD x86_64 the test took 1.8 s in total on Nov 30, 20 s on Dec 1 and 31 s on Dec 2 (limit 20 s), mostly in the kernel; the same binary took 94 s with 14 s of system time and then 2 s on a busy Linux host. A fixed wall-clock limit follows the host's load, not the code. Import 40k and 160k runs in the same process, best of three each, and require less than 10x for 4x the runs.
2026-12-02 20:06:21 +01:00
6 changed files with 51 additions and 27 deletions
+7 -7
View File
@@ -5,23 +5,23 @@ version: 'v0.0.3'
workflows:
'.github/workflows/ci.yml':
- 'actions/checkout@v7.0.1'
- 'step-security/harden-runner@v2.22.4'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/freebsd.yml': []
'.github/workflows/house-rules.yml': []
'.github/workflows/lockfile.yml':
- 'actions/checkout@v7.0.1'
- 'step-security/harden-runner@v2.22.4'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/nightly-dispatch.yml': []
'.github/workflows/nightly-macos.yml':
- 'actions/checkout@v7.0.1'
- 'step-security/harden-runner@v2.22.4'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/nightly-sign.yml': []
'.github/workflows/nightly.yml': []
'.github/workflows/nix.yml': []
'.github/workflows/notify-services.yml': []
'.github/workflows/packaging-lint.yml':
- 'actions/checkout@v7.0.1'
- 'step-security/harden-runner@v2.22.4'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/release.yml': []
'.github/workflows/sonarcloud.yml': []
'.github/workflows/windows-arm64.yml': []
@@ -31,8 +31,8 @@ dependencies:
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
owner_id: 44036562
repo_id: 197814629
'step-security/harden-runner@v2.22.4':
ref: 'v2.22.4'
commit: 'sha1-1d88384fd173af6ecb012dfd0264a306b711241a'
'step-security/harden-runner@v2.23.0':
ref: 'v2.23.0'
commit: 'sha1-aebdcf6156ab6691adf63218240e476564a1ed4c'
owner_id: 88700172
repo_id: 422287306
+1 -1
View File
@@ -27,7 +27,7 @@ jobs:
CRAFT_FONTS_REF: 37827adc41fd165f9a9234ac40f94dbad353aa69
steps:
- name: Harden runner
uses: step-security/harden-runner@v2.22.4
uses: step-security/harden-runner@v2.23.0
with:
egress-policy: audit
- name: Check out craft-fonts
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Harden runner
uses: step-security/harden-runner@v2.22.4
uses: step-security/harden-runner@v2.23.0
with:
egress-policy: audit
- uses: actions/checkout@v7.0.1
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
RUST_BACKTRACE: 1
steps:
- name: Harden runner
uses: step-security/harden-runner@v2.22.4
uses: step-security/harden-runner@v2.23.0
with:
egress-policy: audit
- uses: actions/checkout@v7.0.1
+2 -2
View File
@@ -28,7 +28,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Harden runner
uses: step-security/harden-runner@v2.22.4
uses: step-security/harden-runner@v2.23.0
with:
egress-policy: audit
- uses: actions/checkout@v7.0.1
@@ -58,7 +58,7 @@ jobs:
contents: read
steps:
- name: Harden runner
uses: step-security/harden-runner@v2.22.4
uses: step-security/harden-runner@v2.23.0
with:
egress-policy: audit
- uses: actions/checkout@v7.0.1
+39 -15
View File
@@ -376,18 +376,15 @@ Then wave"
);
}
/// Text with very many formatting runs is laid into runs in about linear time. Each lookup used to
/// scan the run starts from the beginning, so the cost grew with runs²: in a debug build these 640k
/// one-character runs (about 6 MB of file) took 75 s that way, and take about 2 s with binary search.
#[test]
fn many_character_runs_are_not_quadratic() {
const N: usize = 640_000;
let text: String = (0..N).map(|i| if i % 2 == 0 { 'a' } else { '\u{0B}' }).collect();
/// A text box holding `n` one-character formatting runs (a character and a line break, alternating),
/// as a legacy .ppt file.
fn file_with_character_runs(n: usize) -> Vec<u8> {
let text: String = (0..n).map(|i| if i % 2 == 0 { 'a' } else { '\u{0B}' }).collect();
let mut style = vec![];
style.extend_from_slice(&(N as u32 + 1).to_le_bytes());
style.extend_from_slice(&(n as u32 + 1).to_le_bytes());
style.extend_from_slice(&0u16.to_le_bytes());
style.extend_from_slice(&0u32.to_le_bytes()); // a paragraph exception with no fields
for _ in 0..=N {
for _ in 0..=n {
style.extend_from_slice(&1u32.to_le_bytes());
style.extend_from_slice(&0u32.to_le_bytes()); // a character exception with no fields
}
@@ -398,12 +395,39 @@ fn many_character_runs_are_not_quadratic() {
);
let slide = container(rt::SLIDE, 0, &[slide_atom(1, MASTER_ID, 0x7), drawing(None, &[shape])]);
let (cu, doc, pics) = streams_of(0xE391_C05F, 1, slide, None);
let bytes = crate::cfb::build(&[("Current User", &cu), ("PowerPoint Document", &doc), ("Pictures", &pics)]);
let t = std::time::Instant::now();
let p = crate::import(&bytes).unwrap();
assert!(t.elapsed() < std::time::Duration::from_secs(20), "{:?}", t.elapsed());
let runs = &p.slides[0].shapes[0].text.as_ref().unwrap().paragraphs[0].runs;
assert_eq!(runs.iter().filter(|r| r.kind == RunKind::Break).count(), N / 2);
crate::cfb::build(&[("Current User", &cu), ("PowerPoint Document", &doc), ("Pictures", &pics)])
}
/// Text with very many formatting runs is laid into runs in about linear time. Each lookup used to
/// scan the run starts from the beginning, so the cost grew with runs²: 640k one-character runs
/// (about 6 MB of file) took 75 s that way in a debug build, and about 2 s with binary search.
///
/// The test compares two sizes in the same process instead of timing one against a fixed limit, so
/// a slow or busy host (the FreeBSD CI VM took 20 to 31 s for the 640k file, mostly in the kernel,
/// where a quiet one takes 2 s) slows both alike. Four times the runs take about four times as long
/// when the work is linear and sixteen times as long when it is quadratic. Each size is the best of
/// three imports, so a stall in one of them doesn't decide the result.
#[test]
fn many_character_runs_are_not_quadratic() {
const SMALL: usize = 40_000;
const LARGE: usize = 4 * SMALL;
let best_of_three = |n: usize| {
let bytes = file_with_character_runs(n);
let mut best = std::time::Duration::MAX;
let mut breaks = 0;
for _ in 0..3 {
let t = std::time::Instant::now();
let p = crate::import(&bytes).unwrap();
best = best.min(t.elapsed());
let runs = &p.slides[0].shapes[0].text.as_ref().unwrap().paragraphs[0].runs;
breaks = runs.iter().filter(|r| r.kind == RunKind::Break).count();
}
(best, breaks)
};
let (small, small_breaks) = best_of_three(SMALL);
let (large, large_breaks) = best_of_three(LARGE);
assert_eq!((small_breaks, large_breaks), (SMALL / 2, LARGE / 2));
assert!(large < small * 10, "{LARGE} runs took {large:?}, {SMALL} runs took {small:?}: more than 10x for 4x the runs");
}
/// A slide naming a master that doesn't exist falls back to the first main master, every time. The