Skip to content

Introduce Warm-up Phase for Dudect Measurement #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HeatCrab
Copy link
Contributor

@HeatCrab HeatCrab commented Apr 4, 2025

This pull request introduces a warm-up phase to the function that collects and processes measurement batches in qtest.c, skipping the first batch to reduce timing variance in queue operations, such as insert_tail. Inspired by Reparaz et al.’s 2016 paper, "Dude, is my code constant time?", this change adapts the leakage detection approach from the dudect prototype. Unlike the author’s implementation , which uses dynamic percentile checks, this approach employs a static boolean to mark the initial run, better suiting the fixed test loop. Experiments in simulation mode with insert_tail, using perf, show a minor 1.5% reduction in standard deviation (from 449ms to 442ms), suggesting a small improvement in execution stability.

@jserv
Copy link
Contributor

jserv commented Apr 7, 2025

The commit messages were misleading:

  • inspired by a privately implemented earlier version that passed tests => What's that?
  • Dudect paper => Use the fully-qualified form if you want to refer to a paper.
  • the author's GitHub implementation => You should put the name of the author.
  • potential improvements in t-test precision under different test conditions. => How come?

Clarify them before reviewing.

@jserv
Copy link
Contributor

jserv commented May 2, 2025

@HeatCrab, ping?

Inspired by 'Reparaz et al.'s' 2016 paper, this change adds a
warm-up phase to the function that collects and processes
measurement batches, skipping the first batch to reduce timing
variance in queue operations like insert and remove. Unlike the
author's implementation, which uses dynamic percentile checks,
this approach uses a static boolean to mark the initial run,
suiting the fixed test loop. Experiments in simulation mode with
qtest.c and perf show a minor 1.5% reduction in standard deviation
(from 449ms to 442ms), suggesting a small improvement in execution
stability.

Reference: 'Reparaz et al.', "Dude, is my code constant time?", 2016,
https://eprint.iacr.org/2016/1123.pdf

Change-Id: I71692702401c130cd7cac1d424209308baecb87b
@HeatCrab HeatCrab force-pushed the add-warmup-to-measurement branch from 0af65c5 to a51c643 Compare May 7, 2025 07:00
@HeatCrab
Copy link
Contributor Author

HeatCrab commented May 7, 2025

Hi, I’ve submitted a new commit and update the PR comment. Experiments in simulation mode with perf showed a 1.5% timing variance reduction (stddev: 449ms to 442ms), suggesting slight improvements in execution stability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants