MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / validate

Method validate

libatomic/examples/agent_sandbox_bench.rs:148–177  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

146 }
147
148 fn validate(&self) -> Result<()> {
149 ensure!(
150 self.files_east > 0 && self.files_west > 0 && self.lines >= 2 && self.iterations > 0,
151 "file counts and iterations must be positive; lines must be at least two"
152 );
153 ensure!(
154 self.files_east + self.files_west <= 1024
155 && self.lines <= 100_000
156 && self.edits <= 10_000,
157 "fixture exceeds benchmark safety bounds"
158 );
159 ensure!(
160 self.iterations <= 1000
161 && self.warmups <= 1000
162 && self
163 .files_east
164 .checked_add(self.files_west)
165 .is_some_and(|n| n.checked_mul(self.lines).is_some_and(|n| n <= 2_000_000)),
166 "sample count or total fixture lines exceed safety bounds"
167 );
168 ensure!(
169 !cfg!(debug_assertions) || self.allow_debug,
170 "use a --release build (or --allow-debug for correctness smoke tests only)"
171 );
172 ensure!(
173 !self.output.exists(),
174 "refusing to overwrite an existing output report"
175 );
176 Ok(())
177 }
178}
179
180// ————————————————————————————— fixture —————————————————————————————

Callers 2

parseMethod · 0.45
runFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected