Description
Generate intended Boolean transitions with seeded bounded old/new-state bounce prefixes and explicit stable holds/sample times, then delegate consecutive-sample debouncing; retain clean/raw/filtered signals, detected edges, and mismatch counts without promising that filtering reconstructs the clean signal or qualifies hardware.
An operation trace pairs an ordered request stream with the state after each step. Empty operations, ties, evictions, and boundary indexes are part of the modeled contract rather than incidental display details.
Generate intended Boolean transitions with seeded bounded old/new-state bounce prefixes and explicit stable holds/sample times, then delegate consecutive-sample debouncing; retain clean/raw/filtered signals, detected edges, and mismatch counts without promising that filtering reconstructs the clean signal or qualifies hardware.
When to use this tool
Use this generator to create reproducible debounce signal test case cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply initial, transitionCount, initialHoldSamples, stableHoldSamples, maximumBounceSamples, oldStateProbability, requiredSamples, samplePeriodMilliseconds in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read samplePeriodMilliseconds, timesMilliseconds, clean, raw, filtered, intendedTransitions, detectedTransitions, mismatchCounts. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Construct alternating intended Boolean transitions with a sampled bounce segment and stable hold after each. Generate raw samples and ideal clean states, delegate a consecutive-sample debounce filter, and return detected transitions and mismatch counts against clean.1
Delegated operations used for this result: debounce filter. Their calculation or parsing conventions apply to the corresponding result fields.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| initial | Initial | Required. Boolean. |
| transitionCount | Transition Count | Required. Safe integer; minimum 1; maximum 32. |
| initialHoldSamples | Initial Hold Samples | Required. Safe integer; minimum 0; maximum 128. |
| stableHoldSamples | Stable Hold Samples | Required. Safe integer; minimum 1; maximum 128. |
| maximumBounceSamples | Maximum Bounce Samples | Required. Safe integer; minimum 0; maximum 32. |
| oldStateProbability | Old State Probability | Required. Finite number; minimum 0; maximum 1. |
| requiredSamples | Consecutive samples required for a state change. | Required. Safe integer; minimum 1; maximum 100000. |
| samplePeriodMilliseconds | Sample Period Milliseconds | Required. Finite number; strictly above 0. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| samplePeriodMilliseconds | Sample Period Milliseconds | Required. Finite number; strictly above 0. |
| timesMilliseconds | Times Milliseconds | Required. Array of Finite number; minimum 0.; minimum items 1; maximum items 4096. |
| clean | Clean | Required. Array of Boolean.; minimum items 1; maximum items 4096. |
| raw | Raw | Required. Array of Boolean.; minimum items 1; maximum items 4096. |
| filtered | Filtered | Required. Array of Boolean.; minimum items 1; maximum items 4096. |
| intendedTransitions | Intended Transitions | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| intendedTransitions[].startIndex | Start Index | Required. Safe integer; minimum 0; maximum 4095. |
| intendedTransitions[].stableStartIndex | Stable Start Index | Required. Safe integer; minimum 0; maximum 4095. |
| intendedTransitions[].bounceSamples | Bounce Samples | Required. Safe integer; minimum 0; maximum 32. |
| intendedTransitions[].targetState | Target State | Required. Boolean. |
| detectedTransitions | Detected Transitions | Required. Array of Object; no unknown keys.; maximum items 4096. |
| detectedTransitions[].index | Index | Required. Safe integer; minimum 0; maximum 4095. |
| detectedTransitions[].timeMilliseconds | Time Milliseconds | Required. Finite number; minimum 0. |
| detectedTransitions[].state | State | Required. Boolean. |
| mismatchCounts | Mismatch Counts | Required. Object; no unknown keys. |
| mismatchCounts.rawVersusClean | Raw Versus Clean | Required. Safe integer; minimum 0; maximum 4096. |
| mismatchCounts.filteredVersusClean | Filtered Versus Clean | Required. Safe integer; minimum 0; maximum 4096. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"initial": false,
"transitionCount": 2,
"initialHoldSamples": 2,
"stableHoldSamples": 3,
"maximumBounceSamples": 2,
"oldStateProbability": 0.5,
"requiredSamples": 2,
"samplePeriodMilliseconds": 10,
"seed": 42
},
"output": {
"samplePeriodMilliseconds": 10,
"timesMilliseconds": [
0,
10,
20,
30,
40,
50,
60,
70,
80,
90,
100
],
"clean": [
false,
false,
true,
true,
true,
true,
false,
false,
false,
false,
false
],
"raw": [
false,
false,
false,
true,
true,
true,
false,
true,
false,
false,
false
],
"filtered": [
false,
false,
false,
false,
true,
true,
true,
true,
true,
false,
false
],
"intendedTransitions": [
{
"startIndex": 2,
"stableStartIndex": 3,
"bounceSamples": 1,
"targetState": true
},
{
"startIndex": 6,
"stableStartIndex": 8,
"bounceSamples": 2,
"targetState": false
}
],
"detectedTransitions": [
{
"index": 4,
"timeMilliseconds": 40,
"state": true
},
{
"index": 9,
"timeMilliseconds": 90,
"state": false
}
],
"mismatchCounts": {
"rawVersusClean": 2,
"filteredVersusClean": 5
},
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Debouncing can delay transitions and may increase some sample-by-sample mismatches. Time spacing must remain finite and strictly increasing. This is a discrete signal fixture rather than tested electrical hardware or safety control.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Two-Table Cuckoo Hashing Trace Tool
Trace insertion evictions, lookups and deletion in two fixed-size integer-key cuckoo tables using h1(k)=k mod m and h2(k)=floor(k/m) mod m; a kick limit rolls back the insertion and signals rehash-needed, without automatic resizing or hash-quality guarantees.
- Random Binary Search Boundary Corpus Generator
Generate a sorted integer array with a present query, absent endpoint controls and caller targets, retaining exact binary lower/upper indices cross-checked against frequency counts.