GZip 메모리 판독기 공개 API 회귀를 추가함
- 작성자
- 코노모리 카논
- 작성 시각
- 커밋
6022c7e6c70def5996d853116ad1dfd97f90e19f- 부모
- e1ffd7b
변경된 파일 13개
+2,716-0| @@ -0,0 +1,23 @@ | ||
| 1 | 추가: # This file is automatically @generated by Cargo. | |
| 2 | 추가: # It is not intended for manual editing. | |
| 3 | 추가: version = 4 | |
| 4 | 추가: | |
| 5 | 추가: [[package]] | |
| 6 | 추가: name = "zipelo-memory-gzip-reader" | |
| 7 | 추가: version = "0.1.0" | |
| 8 | 추가: dependencies = [ | |
| 9 | 추가: "zlib-rs", | |
| 10 | 추가: ] | |
| 11 | 추가: | |
| 12 | 추가: [[package]] | |
| 13 | 추가: name = "zlib-rs" | |
| 14 | 추가: version = "0.6.8" | |
| 15 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 16 | 추가: checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" | |
| 17 | 추가: | |
| 18 | 추가: [[package]] | |
| 19 | 추가: name = "zipelo-memory-gzip-regressions" | |
| 20 | 추가: version = "0.1.0" | |
| 21 | 추가: dependencies = [ | |
| 22 | 추가: "zipelo-memory-gzip-reader", | |
| 23 | 추가: ] |
| @@ -0,0 +1,16 @@ | ||
| 1 | 추가: [package] | |
| 2 | 추가: name = "zipelo-memory-gzip-regressions" | |
| 3 | 추가: version = "0.1.0" | |
| 4 | 추가: edition = "2024" | |
| 5 | 추가: license = "MIT" | |
| 6 | 추가: publish = false | |
| 7 | 추가: autotests = false | |
| 8 | 추가: | |
| 9 | 추가: [dependencies] | |
| 10 | 추가: zipelo-memory-gzip-reader = { path = "../../experiments/rust-memory-gzip-reader" } | |
| 11 | 추가: | |
| 12 | 추가: [[test]] | |
| 13 | 추가: name = "memory_gzip_reader" | |
| 14 | 추가: path = "main.rs" | |
| 15 | 추가: | |
| 16 | 추가: [workspace] |
| @@ -0,0 +1,12 @@ | ||
| 1 | 추가: 5932825be6b65fda2dc957a18992db63673e6eecdd55853fb743c133f359262c Cargo.lock | |
| 2 | 추가: 2e8476195852aaec340015755ecb37ef8fa65d5ba375f8c7a60e3b8d0643ed1e Cargo.toml | |
| 3 | 추가: d1b5132d656d514d73ac0f510991fab70d0c8783b9a10bf6314149a6d7a3649c budgets.rs | |
| 4 | 추가: 6e995ed0edf29c0b4f513ddb0a9e56b427cefbd58e78351674ad0e4ee490de74 checkpoints.rs | |
| 5 | 추가: 4210819bd39c431c226b8665dcf3af479190d8d51c849eff1114fa70b559cd7f contract.json | |
| 6 | 추가: e0768b8c44a7e6586bc423eea561da49eecbf5114130d88992b2c6c5893ae355 fixtures.hex | |
| 7 | 추가: 329cbac0a9b5b064ef1db4c59d83860c97a6d2819e4659405b75e17bdc82b45d fixtures.json | |
| 8 | 추가: b5a6c624e9911aa4e818612cc7a868a43313ee1e1c63b6352b8410ed896154c5 format.rs | |
| 9 | 추가: 1cde1dd2f913820f77458e5accfcdb91aec5a1319e3c0fb2d91fd7e385690831 generate_fixtures.py | |
| 10 | 추가: 036865bd2661062ea59d84362fdd747d9ce79d9b78400f12be3bea7703466020 main.rs | |
| 11 | 추가: 9ec4c5b4e90c9740a8224a0c272e1bb340996f3d6cb5452b2b72e3bd3a6212c9 static_check.py | |
| 12 | 추가: a4d39c7b9b9270eb31fb3e73d9ebd57c9ba78a99b73851944bdd4d645e8d5fc5 support.rs |
| @@ -0,0 +1,785 @@ | ||
| 1 | 추가: use crate::support::*; | |
| 2 | 추가: use zipelo_memory_gzip_reader::{Budget, Error, Failure, InflateError, Limits, Stage, Stop, Usage}; | |
| 3 | 추가: | |
| 4 | 추가: #[derive(Clone, Copy)] | |
| 5 | 추가: enum Field { | |
| 6 | 추가: Input, | |
| 7 | 추가: Processed, | |
| 8 | 추가: Output, | |
| 9 | 추가: Metadata, | |
| 10 | 추가: } | |
| 11 | 추가: | |
| 12 | 추가: fn limit(field: Field, value: u64) -> Limits { | |
| 13 | 추가: let mut limits = Limits::default(); | |
| 14 | 추가: match field { | |
| 15 | 추가: Field::Input => limits.input = value, | |
| 16 | 추가: Field::Processed => limits.processed = value, | |
| 17 | 추가: Field::Output => limits.output = value, | |
| 18 | 추가: Field::Metadata => limits.metadata = value, | |
| 19 | 추가: } | |
| 20 | 추가: limits | |
| 21 | 추가: } | |
| 22 | 추가: | |
| 23 | 추가: fn boundary(field: Field, value: u64, selected: bool, succeeds: bool, expected: Usage) { | |
| 24 | 추가: let mut budget = Budget::new(limit(field, value)).unwrap(); | |
| 25 | 추가: let result = read(&normal(), selected, &mut budget); | |
| 26 | 추가: if succeeds { | |
| 27 | 추가: assert_eq!( | |
| 28 | 추가: result.unwrap().bytes, | |
| 29 | 추가: selected.then(|| b"123456789".to_vec()) | |
| 30 | 추가: ); | |
| 31 | 추가: } else { | |
| 32 | 추가: reader_error(result, Failure::Budget); | |
| 33 | 추가: } | |
| 34 | 추가: assert_eq!(budget.usage(), expected); | |
| 35 | 추가: } | |
| 36 | 추가: | |
| 37 | 추가: fn failed_decode(selected: bool, overrun: bool) { | |
| 38 | 추가: let input = bad_after_output(); | |
| 39 | 추가: let mut budget = Budget::new(limit( | |
| 40 | 추가: Field::Processed, | |
| 41 | 추가: input.len() as u64 + u64::from(!overrun), | |
| 42 | 추가: )) | |
| 43 | 추가: .unwrap(); | |
| 44 | 추가: let mut reached_after = false; | |
| 45 | 추가: let result = zipelo_memory_gzip_reader::read(request(&input, selected), &mut budget, |point| { | |
| 46 | 추가: if matches!( | |
| 47 | 추가: point.stage, | |
| 48 | 추가: Stage::AfterInflate | Stage::AfterOutput | Stage::Trailer | Stage::BeforeReturn | |
| 49 | 추가: ) { | |
| 50 | 추가: reached_after = true; | |
| 51 | 추가: return Err(Stop::<()>::Cancelled); | |
| 52 | 추가: } | |
| 53 | 추가: Ok(()) | |
| 54 | 추가: }); | |
| 55 | 추가: if overrun { | |
| 56 | 추가: reader_error(result, Failure::Budget); | |
| 57 | 추가: } else { | |
| 58 | 추가: assert!( | |
| 59 | 추가: matches!(result, Err(Error::Backend(InflateError::DataError))), | |
| 60 | 추가: "{result:?}" | |
| 61 | 추가: ); | |
| 62 | 추가: } | |
| 63 | 추가: assert!(!reached_after); | |
| 64 | 추가: assert_eq!( | |
| 65 | 추가: budget.usage(), | |
| 66 | 추가: Usage { | |
| 67 | 추가: processed: input.len() as u64 + 1, | |
| 68 | 추가: output: 0, | |
| 69 | 추가: metadata: 10 | |
| 70 | 추가: } | |
| 71 | 추가: ); | |
| 72 | 추가: let previous = budget.usage(); | |
| 73 | 추가: let mut stages = Vec::new(); | |
| 74 | 추가: let retry = | |
| 75 | 추가: zipelo_memory_gzip_reader::read(request(&normal(), selected), &mut budget, |point| { | |
| 76 | 추가: stages.push(point.stage); | |
| 77 | 추가: Ok::<_, Stop<()>>(()) | |
| 78 | 추가: }); | |
| 79 | 추가: reader_error(retry, Failure::Budget); | |
| 80 | 추가: if overrun { | |
| 81 | 추가: assert_eq!(stages, vec![Stage::Start]); | |
| 82 | 추가: assert_eq!(budget.usage(), previous); | |
| 83 | 추가: } else { | |
| 84 | 추가: assert!(!stages.contains(&Stage::BeforeInflate)); | |
| 85 | 추가: assert_eq!(budget.usage().processed, previous.processed); | |
| 86 | 추가: assert_eq!(budget.usage().metadata, previous.metadata + 1); | |
| 87 | 추가: } | |
| 88 | 추가: } | |
| 89 | 추가: | |
| 90 | 추가: #[test] | |
| 91 | 추가: fn input_29_selected() { | |
| 92 | 추가: boundary( | |
| 93 | 추가: Field::Input, | |
| 94 | 추가: 29, | |
| 95 | 추가: true, | |
| 96 | 추가: true, | |
| 97 | 추가: Usage { | |
| 98 | 추가: processed: 38, | |
| 99 | 추가: output: 9, | |
| 100 | 추가: metadata: 10, | |
| 101 | 추가: }, | |
| 102 | 추가: ); | |
| 103 | 추가: } | |
| 104 | 추가: | |
| 105 | 추가: #[test] | |
| 106 | 추가: fn input_28_selected() { | |
| 107 | 추가: boundary( | |
| 108 | 추가: Field::Input, | |
| 109 | 추가: 28, | |
| 110 | 추가: true, | |
| 111 | 추가: false, | |
| 112 | 추가: Usage { | |
| 113 | 추가: processed: 0, | |
| 114 | 추가: output: 0, | |
| 115 | 추가: metadata: 0, | |
| 116 | 추가: }, | |
| 117 | 추가: ); | |
| 118 | 추가: } | |
| 119 | 추가: | |
| 120 | 추가: #[test] | |
| 121 | 추가: fn processed_38_selected() { | |
| 122 | 추가: boundary( | |
| 123 | 추가: Field::Processed, | |
| 124 | 추가: 38, | |
| 125 | 추가: true, | |
| 126 | 추가: true, | |
| 127 | 추가: Usage { | |
| 128 | 추가: processed: 38, | |
| 129 | 추가: output: 9, | |
| 130 | 추가: metadata: 10, | |
| 131 | 추가: }, | |
| 132 | 추가: ); | |
| 133 | 추가: } | |
| 134 | 추가: | |
| 135 | 추가: #[test] | |
| 136 | 추가: fn processed_37_selected() { | |
| 137 | 추가: boundary( | |
| 138 | 추가: Field::Processed, | |
| 139 | 추가: 37, | |
| 140 | 추가: true, | |
| 141 | 추가: false, | |
| 142 | 추가: Usage { | |
| 143 | 추가: processed: 38, | |
| 144 | 추가: output: 0, | |
| 145 | 추가: metadata: 10, | |
| 146 | 추가: }, | |
| 147 | 추가: ); | |
| 148 | 추가: } | |
| 149 | 추가: | |
| 150 | 추가: #[test] | |
| 151 | 추가: fn output_9_selected() { | |
| 152 | 추가: boundary( | |
| 153 | 추가: Field::Output, | |
| 154 | 추가: 9, | |
| 155 | 추가: true, | |
| 156 | 추가: true, | |
| 157 | 추가: Usage { | |
| 158 | 추가: processed: 38, | |
| 159 | 추가: output: 9, | |
| 160 | 추가: metadata: 10, | |
| 161 | 추가: }, | |
| 162 | 추가: ); | |
| 163 | 추가: } | |
| 164 | 추가: | |
| 165 | 추가: #[test] | |
| 166 | 추가: fn output_8_selected() { | |
| 167 | 추가: boundary( | |
| 168 | 추가: Field::Output, | |
| 169 | 추가: 8, | |
| 170 | 추가: true, | |
| 171 | 추가: false, | |
| 172 | 추가: Usage { | |
| 173 | 추가: processed: 38, | |
| 174 | 추가: output: 0, | |
| 175 | 추가: metadata: 10, | |
| 176 | 추가: }, | |
| 177 | 추가: ); | |
| 178 | 추가: } | |
| 179 | 추가: | |
| 180 | 추가: #[test] | |
| 181 | 추가: fn metadata_10_selected() { | |
| 182 | 추가: boundary( | |
| 183 | 추가: Field::Metadata, | |
| 184 | 추가: 10, | |
| 185 | 추가: true, | |
| 186 | 추가: true, | |
| 187 | 추가: Usage { | |
| 188 | 추가: processed: 38, | |
| 189 | 추가: output: 9, | |
| 190 | 추가: metadata: 10, | |
| 191 | 추가: }, | |
| 192 | 추가: ); | |
| 193 | 추가: } | |
| 194 | 추가: | |
| 195 | 추가: #[test] | |
| 196 | 추가: fn metadata_9_selected() { | |
| 197 | 추가: boundary( | |
| 198 | 추가: Field::Metadata, | |
| 199 | 추가: 9, | |
| 200 | 추가: true, | |
| 201 | 추가: false, | |
| 202 | 추가: Usage { | |
| 203 | 추가: processed: 9, | |
| 204 | 추가: output: 0, | |
| 205 | 추가: metadata: 9, | |
| 206 | 추가: }, | |
| 207 | 추가: ); | |
| 208 | 추가: } | |
| 209 | 추가: | |
| 210 | 추가: #[test] | |
| 211 | 추가: fn input_0_selected() { | |
| 212 | 추가: boundary( | |
| 213 | 추가: Field::Input, | |
| 214 | 추가: 0, | |
| 215 | 추가: true, | |
| 216 | 추가: false, | |
| 217 | 추가: Usage { | |
| 218 | 추가: processed: 0, | |
| 219 | 추가: output: 0, | |
| 220 | 추가: metadata: 0, | |
| 221 | 추가: }, | |
| 222 | 추가: ); | |
| 223 | 추가: } | |
| 224 | 추가: | |
| 225 | 추가: #[test] | |
| 226 | 추가: fn processed_0_selected() { | |
| 227 | 추가: boundary( | |
| 228 | 추가: Field::Processed, | |
| 229 | 추가: 0, | |
| 230 | 추가: true, | |
| 231 | 추가: false, | |
| 232 | 추가: Usage { | |
| 233 | 추가: processed: 0, | |
| 234 | 추가: output: 0, | |
| 235 | 추가: metadata: 1, | |
| 236 | 추가: }, | |
| 237 | 추가: ); | |
| 238 | 추가: } | |
| 239 | 추가: | |
| 240 | 추가: #[test] | |
| 241 | 추가: fn output_0_selected() { | |
| 242 | 추가: boundary( | |
| 243 | 추가: Field::Output, | |
| 244 | 추가: 0, | |
| 245 | 추가: true, | |
| 246 | 추가: false, | |
| 247 | 추가: Usage { | |
| 248 | 추가: processed: 38, | |
| 249 | 추가: output: 0, | |
| 250 | 추가: metadata: 10, | |
| 251 | 추가: }, | |
| 252 | 추가: ); | |
| 253 | 추가: } | |
| 254 | 추가: | |
| 255 | 추가: #[test] | |
| 256 | 추가: fn metadata_0_selected() { | |
| 257 | 추가: boundary( | |
| 258 | 추가: Field::Metadata, | |
| 259 | 추가: 0, | |
| 260 | 추가: true, | |
| 261 | 추가: false, | |
| 262 | 추가: Usage { | |
| 263 | 추가: processed: 0, | |
| 264 | 추가: output: 0, | |
| 265 | 추가: metadata: 0, | |
| 266 | 추가: }, | |
| 267 | 추가: ); | |
| 268 | 추가: } | |
| 269 | 추가: | |
| 270 | 추가: #[test] | |
| 271 | 추가: fn backend_error_output_charged_selected() { | |
| 272 | 추가: failed_decode(true, false); | |
| 273 | 추가: } | |
| 274 | 추가: #[test] | |
| 275 | 추가: fn output_overrun_precedes_backend_selected() { | |
| 276 | 추가: failed_decode(true, true); | |
| 277 | 추가: } | |
| 278 | 추가: #[test] | |
| 279 | 추가: fn exact_all_limits_selected() { | |
| 280 | 추가: let mut budget = Budget::new(Limits { | |
| 281 | 추가: input: 29, | |
| 282 | 추가: processed: 38, | |
| 283 | 추가: output: 9, | |
| 284 | 추가: metadata: 10, | |
| 285 | 추가: ..Limits::default() | |
| 286 | 추가: }) | |
| 287 | 추가: .unwrap(); | |
| 288 | 추가: assert!(read(&normal(), true, &mut budget).is_ok()); | |
| 289 | 추가: } | |
| 290 | 추가: #[test] | |
| 291 | 추가: fn crc_failure_retains_cost_and_retry_selected() { | |
| 292 | 추가: let mut input = normal(); | |
| 293 | 추가: input[21] ^= 1; | |
| 294 | 추가: let mut budget = Budget::new(Limits { | |
| 295 | 추가: processed: 76, | |
| 296 | 추가: output: 18, | |
| 297 | 추가: metadata: 20, | |
| 298 | 추가: ..Limits::default() | |
| 299 | 추가: }) | |
| 300 | 추가: .unwrap(); | |
| 301 | 추가: reader_error(read(&input, true, &mut budget), Failure::Crc); | |
| 302 | 추가: assert_eq!( | |
| 303 | 추가: budget.usage(), | |
| 304 | 추가: Usage { | |
| 305 | 추가: processed: 38, | |
| 306 | 추가: output: 9, | |
| 307 | 추가: metadata: 10 | |
| 308 | 추가: } | |
| 309 | 추가: ); | |
| 310 | 추가: let completed = read(&normal(), true, &mut budget).unwrap(); | |
| 311 | 추가: assert_eq!( | |
| 312 | 추가: completed.usage, | |
| 313 | 추가: Usage { | |
| 314 | 추가: processed: 76, | |
| 315 | 추가: output: 18, | |
| 316 | 추가: metadata: 20 | |
| 317 | 추가: } | |
| 318 | 추가: ); | |
| 319 | 추가: } | |
| 320 | 추가: #[test] | |
| 321 | 추가: fn cumulative_processed_selected() { | |
| 322 | 추가: let mut budget = Budget::new(limit(Field::Processed, 75)).unwrap(); | |
| 323 | 추가: read(&normal(), true, &mut budget).unwrap(); | |
| 324 | 추가: reader_error(read(&normal(), true, &mut budget), Failure::Budget); | |
| 325 | 추가: assert_eq!( | |
| 326 | 추가: budget.usage(), | |
| 327 | 추가: Usage { | |
| 328 | 추가: processed: 76, | |
| 329 | 추가: output: 9, | |
| 330 | 추가: metadata: 20 | |
| 331 | 추가: } | |
| 332 | 추가: ); | |
| 333 | 추가: } | |
| 334 | 추가: #[test] | |
| 335 | 추가: fn cumulative_metadata_selected() { | |
| 336 | 추가: let mut budget = Budget::new(limit(Field::Metadata, 19)).unwrap(); | |
| 337 | 추가: read(&normal(), true, &mut budget).unwrap(); | |
| 338 | 추가: reader_error(read(&normal(), true, &mut budget), Failure::Budget); | |
| 339 | 추가: assert_eq!( | |
| 340 | 추가: budget.usage(), | |
| 341 | 추가: Usage { | |
| 342 | 추가: processed: 47, | |
| 343 | 추가: output: 9, | |
| 344 | 추가: metadata: 19 | |
| 345 | 추가: } | |
| 346 | 추가: ); | |
| 347 | 추가: } | |
| 348 | 추가: #[test] | |
| 349 | 추가: fn input_cap_is_per_request_selected() { | |
| 350 | 추가: let mut budget = Budget::new(limit(Field::Input, 29)).unwrap(); | |
| 351 | 추가: read(&normal(), true, &mut budget).unwrap(); | |
| 352 | 추가: read(&normal(), true, &mut budget).unwrap(); | |
| 353 | 추가: assert_eq!(budget.usage().processed, 76); | |
| 354 | 추가: } | |
| 355 | 추가: #[test] | |
| 356 | 추가: fn selected_empty_zero_output_selected() { | |
| 357 | 추가: let mut budget = Budget::new(limit(Field::Output, 0)).unwrap(); | |
| 358 | 추가: let result = read(&fixture("empty_fixed"), true, &mut budget).unwrap(); | |
| 359 | 추가: assert_eq!(result.bytes, true.then(Vec::new)); | |
| 360 | 추가: assert_eq!(result.usage.output, 0); | |
| 361 | 추가: } | |
| 362 | 추가: | |
| 363 | 추가: #[test] | |
| 364 | 추가: fn input_29_unselected() { | |
| 365 | 추가: boundary( | |
| 366 | 추가: Field::Input, | |
| 367 | 추가: 29, | |
| 368 | 추가: false, | |
| 369 | 추가: true, | |
| 370 | 추가: Usage { | |
| 371 | 추가: processed: 38, | |
| 372 | 추가: output: 0, | |
| 373 | 추가: metadata: 10, | |
| 374 | 추가: }, | |
| 375 | 추가: ); | |
| 376 | 추가: } | |
| 377 | 추가: | |
| 378 | 추가: #[test] | |
| 379 | 추가: fn input_28_unselected() { | |
| 380 | 추가: boundary( | |
| 381 | 추가: Field::Input, | |
| 382 | 추가: 28, | |
| 383 | 추가: false, | |
| 384 | 추가: false, | |
| 385 | 추가: Usage { | |
| 386 | 추가: processed: 0, | |
| 387 | 추가: output: 0, | |
| 388 | 추가: metadata: 0, | |
| 389 | 추가: }, | |
| 390 | 추가: ); | |
| 391 | 추가: } | |
| 392 | 추가: | |
| 393 | 추가: #[test] | |
| 394 | 추가: fn processed_38_unselected() { | |
| 395 | 추가: boundary( | |
| 396 | 추가: Field::Processed, | |
| 397 | 추가: 38, | |
| 398 | 추가: false, | |
| 399 | 추가: true, | |
| 400 | 추가: Usage { | |
| 401 | 추가: processed: 38, | |
| 402 | 추가: output: 0, | |
| 403 | 추가: metadata: 10, | |
| 404 | 추가: }, | |
| 405 | 추가: ); | |
| 406 | 추가: } | |
| 407 | 추가: | |
| 408 | 추가: #[test] | |
| 409 | 추가: fn processed_37_unselected() { | |
| 410 | 추가: boundary( | |
| 411 | 추가: Field::Processed, | |
| 412 | 추가: 37, | |
| 413 | 추가: false, | |
| 414 | 추가: false, | |
| 415 | 추가: Usage { | |
| 416 | 추가: processed: 38, | |
| 417 | 추가: output: 0, | |
| 418 | 추가: metadata: 10, | |
| 419 | 추가: }, | |
| 420 | 추가: ); | |
| 421 | 추가: } | |
| 422 | 추가: | |
| 423 | 추가: #[test] | |
| 424 | 추가: fn output_9_unselected() { | |
| 425 | 추가: boundary( | |
| 426 | 추가: Field::Output, | |
| 427 | 추가: 9, | |
| 428 | 추가: false, | |
| 429 | 추가: true, | |
| 430 | 추가: Usage { | |
| 431 | 추가: processed: 38, | |
| 432 | 추가: output: 0, | |
| 433 | 추가: metadata: 10, | |
| 434 | 추가: }, | |
| 435 | 추가: ); | |
| 436 | 추가: } | |
| 437 | 추가: | |
| 438 | 추가: #[test] | |
| 439 | 추가: fn output_8_unselected() { | |
| 440 | 추가: boundary( | |
| 441 | 추가: Field::Output, | |
| 442 | 추가: 8, | |
| 443 | 추가: false, | |
| 444 | 추가: true, | |
| 445 | 추가: Usage { | |
| 446 | 추가: processed: 38, | |
| 447 | 추가: output: 0, | |
| 448 | 추가: metadata: 10, | |
| 449 | 추가: }, | |
| 450 | 추가: ); | |
| 451 | 추가: } | |
| 452 | 추가: | |
| 453 | 추가: #[test] | |
| 454 | 추가: fn metadata_10_unselected() { | |
| 455 | 추가: boundary( | |
| 456 | 추가: Field::Metadata, | |
| 457 | 추가: 10, | |
| 458 | 추가: false, | |
| 459 | 추가: true, | |
| 460 | 추가: Usage { | |
| 461 | 추가: processed: 38, | |
| 462 | 추가: output: 0, | |
| 463 | 추가: metadata: 10, | |
| 464 | 추가: }, | |
| 465 | 추가: ); | |
| 466 | 추가: } | |
| 467 | 추가: | |
| 468 | 추가: #[test] | |
| 469 | 추가: fn metadata_9_unselected() { | |
| 470 | 추가: boundary( | |
| 471 | 추가: Field::Metadata, | |
| 472 | 추가: 9, | |
| 473 | 추가: false, | |
| 474 | 추가: false, | |
| 475 | 추가: Usage { | |
| 476 | 추가: processed: 9, | |
| 477 | 추가: output: 0, | |
| 478 | 추가: metadata: 9, | |
| 479 | 추가: }, | |
| 480 | 추가: ); | |
| 481 | 추가: } | |
| 482 | 추가: | |
| 483 | 추가: #[test] | |
| 484 | 추가: fn input_0_unselected() { | |
| 485 | 추가: boundary( | |
| 486 | 추가: Field::Input, | |
| 487 | 추가: 0, | |
| 488 | 추가: false, | |
| 489 | 추가: false, | |
| 490 | 추가: Usage { | |
| 491 | 추가: processed: 0, | |
| 492 | 추가: output: 0, | |
| 493 | 추가: metadata: 0, | |
| 494 | 추가: }, | |
| 495 | 추가: ); | |
| 496 | 추가: } | |
| 497 | 추가: | |
| 498 | 추가: #[test] | |
| 499 | 추가: fn processed_0_unselected() { | |
| 500 | 추가: boundary( | |
| 501 | 추가: Field::Processed, | |
| 502 | 추가: 0, | |
| 503 | 추가: false, | |
| 504 | 추가: false, | |
| 505 | 추가: Usage { | |
| 506 | 추가: processed: 0, | |
| 507 | 추가: output: 0, | |
| 508 | 추가: metadata: 1, | |
| 509 | 추가: }, | |
| 510 | 추가: ); | |
| 511 | 추가: } | |
| 512 | 추가: | |
| 513 | 추가: #[test] | |
| 514 | 추가: fn output_0_unselected() { | |
| 515 | 추가: boundary( | |
| 516 | 추가: Field::Output, | |
| 517 | 추가: 0, | |
| 518 | 추가: false, | |
| 519 | 추가: true, | |
| 520 | 추가: Usage { | |
| 521 | 추가: processed: 38, | |
| 522 | 추가: output: 0, | |
| 523 | 추가: metadata: 10, | |
| 524 | 추가: }, | |
| 525 | 추가: ); | |
| 526 | 추가: } | |
| 527 | 추가: | |
| 528 | 추가: #[test] | |
| 529 | 추가: fn metadata_0_unselected() { | |
| 530 | 추가: boundary( | |
| 531 | 추가: Field::Metadata, | |
| 532 | 추가: 0, | |
| 533 | 추가: false, | |
| 534 | 추가: false, | |
| 535 | 추가: Usage { | |
| 536 | 추가: processed: 0, | |
| 537 | 추가: output: 0, | |
| 538 | 추가: metadata: 0, | |
| 539 | 추가: }, | |
| 540 | 추가: ); | |
| 541 | 추가: } | |
| 542 | 추가: | |
| 543 | 추가: #[test] | |
| 544 | 추가: fn backend_error_output_charged_unselected() { | |
| 545 | 추가: failed_decode(false, false); | |
| 546 | 추가: } | |
| 547 | 추가: #[test] | |
| 548 | 추가: fn output_overrun_precedes_backend_unselected() { | |
| 549 | 추가: failed_decode(false, true); | |
| 550 | 추가: } | |
| 551 | 추가: #[test] | |
| 552 | 추가: fn exact_all_limits_unselected() { | |
| 553 | 추가: let mut budget = Budget::new(Limits { | |
| 554 | 추가: input: 29, | |
| 555 | 추가: processed: 38, | |
| 556 | 추가: output: 0, | |
| 557 | 추가: metadata: 10, | |
| 558 | 추가: ..Limits::default() | |
| 559 | 추가: }) | |
| 560 | 추가: .unwrap(); | |
| 561 | 추가: assert!(read(&normal(), false, &mut budget).is_ok()); | |
| 562 | 추가: } | |
| 563 | 추가: #[test] | |
| 564 | 추가: fn crc_failure_retains_cost_and_retry_unselected() { | |
| 565 | 추가: let mut input = normal(); | |
| 566 | 추가: input[21] ^= 1; | |
| 567 | 추가: let mut budget = Budget::new(Limits { | |
| 568 | 추가: processed: 76, | |
| 569 | 추가: output: 18, | |
| 570 | 추가: metadata: 20, | |
| 571 | 추가: ..Limits::default() | |
| 572 | 추가: }) | |
| 573 | 추가: .unwrap(); | |
| 574 | 추가: reader_error(read(&input, false, &mut budget), Failure::Crc); | |
| 575 | 추가: assert_eq!( | |
| 576 | 추가: budget.usage(), | |
| 577 | 추가: Usage { | |
| 578 | 추가: processed: 38, | |
| 579 | 추가: output: 0, | |
| 580 | 추가: metadata: 10 | |
| 581 | 추가: } | |
| 582 | 추가: ); | |
| 583 | 추가: let completed = read(&normal(), false, &mut budget).unwrap(); | |
| 584 | 추가: assert_eq!( | |
| 585 | 추가: completed.usage, | |
| 586 | 추가: Usage { | |
| 587 | 추가: processed: 76, | |
| 588 | 추가: output: 0, | |
| 589 | 추가: metadata: 20 | |
| 590 | 추가: } | |
| 591 | 추가: ); | |
| 592 | 추가: } | |
| 593 | 추가: #[test] | |
| 594 | 추가: fn cumulative_processed_unselected() { | |
| 595 | 추가: let mut budget = Budget::new(limit(Field::Processed, 75)).unwrap(); | |
| 596 | 추가: read(&normal(), false, &mut budget).unwrap(); | |
| 597 | 추가: reader_error(read(&normal(), false, &mut budget), Failure::Budget); | |
| 598 | 추가: assert_eq!( | |
| 599 | 추가: budget.usage(), | |
| 600 | 추가: Usage { | |
| 601 | 추가: processed: 76, | |
| 602 | 추가: output: 0, | |
| 603 | 추가: metadata: 20 | |
| 604 | 추가: } | |
| 605 | 추가: ); | |
| 606 | 추가: } | |
| 607 | 추가: #[test] | |
| 608 | 추가: fn cumulative_metadata_unselected() { | |
| 609 | 추가: let mut budget = Budget::new(limit(Field::Metadata, 19)).unwrap(); | |
| 610 | 추가: read(&normal(), false, &mut budget).unwrap(); | |
| 611 | 추가: reader_error(read(&normal(), false, &mut budget), Failure::Budget); | |
| 612 | 추가: assert_eq!( | |
| 613 | 추가: budget.usage(), | |
| 614 | 추가: Usage { | |
| 615 | 추가: processed: 47, | |
| 616 | 추가: output: 0, | |
| 617 | 추가: metadata: 19 | |
| 618 | 추가: } | |
| 619 | 추가: ); | |
| 620 | 추가: } | |
| 621 | 추가: #[test] | |
| 622 | 추가: fn input_cap_is_per_request_unselected() { | |
| 623 | 추가: let mut budget = Budget::new(limit(Field::Input, 29)).unwrap(); | |
| 624 | 추가: read(&normal(), false, &mut budget).unwrap(); | |
| 625 | 추가: read(&normal(), false, &mut budget).unwrap(); | |
| 626 | 추가: assert_eq!(budget.usage().processed, 76); | |
| 627 | 추가: } | |
| 628 | 추가: #[test] | |
| 629 | 추가: fn selected_empty_zero_output_unselected() { | |
| 630 | 추가: let mut budget = Budget::new(limit(Field::Output, 0)).unwrap(); | |
| 631 | 추가: let result = read(&fixture("empty_fixed"), false, &mut budget).unwrap(); | |
| 632 | 추가: assert_eq!(result.bytes, false.then(Vec::new)); | |
| 633 | 추가: assert_eq!(result.usage.output, 0); | |
| 634 | 추가: } | |
| 635 | 추가: | |
| 636 | 추가: #[test] | |
| 637 | 추가: fn cumulative_selected_output() { | |
| 638 | 추가: let mut budget = Budget::new(limit(Field::Output, 17)).unwrap(); | |
| 639 | 추가: read(&normal(), true, &mut budget).unwrap(); | |
| 640 | 추가: reader_error(read(&normal(), true, &mut budget), Failure::Budget); | |
| 641 | 추가: assert_eq!( | |
| 642 | 추가: budget.usage(), | |
| 643 | 추가: Usage { | |
| 644 | 추가: processed: 76, | |
| 645 | 추가: output: 9, | |
| 646 | 추가: metadata: 20 | |
| 647 | 추가: } | |
| 648 | 추가: ); | |
| 649 | 추가: } | |
| 650 | 추가: | |
| 651 | 추가: #[test] | |
| 652 | 추가: fn shared_budget_selected_then_unselected() { | |
| 653 | 추가: let mut budget = Budget::new(limit(Field::Output, 9)).unwrap(); | |
| 654 | 추가: read(&normal(), true, &mut budget).unwrap(); | |
| 655 | 추가: let done = read(&normal(), false, &mut budget).unwrap(); | |
| 656 | 추가: assert_eq!(done.bytes, None); | |
| 657 | 추가: assert_eq!( | |
| 658 | 추가: done.usage, | |
| 659 | 추가: Usage { | |
| 660 | 추가: processed: 76, | |
| 661 | 추가: output: 9, | |
| 662 | 추가: metadata: 20 | |
| 663 | 추가: } | |
| 664 | 추가: ); | |
| 665 | 추가: } | |
| 666 | 추가: | |
| 667 | 추가: #[test] | |
| 668 | 추가: fn shared_budget_unselected_then_selected() { | |
| 669 | 추가: let mut budget = Budget::new(limit(Field::Output, 9)).unwrap(); | |
| 670 | 추가: read(&normal(), false, &mut budget).unwrap(); | |
| 671 | 추가: let done = read(&normal(), true, &mut budget).unwrap(); | |
| 672 | 추가: assert_eq!(done.bytes, Some(b"123456789".to_vec())); | |
| 673 | 추가: assert_eq!( | |
| 674 | 추가: done.usage, | |
| 675 | 추가: Usage { | |
| 676 | 추가: processed: 76, | |
| 677 | 추가: output: 9, | |
| 678 | 추가: metadata: 20 | |
| 679 | 추가: } | |
| 680 | 추가: ); | |
| 681 | 추가: } | |
| 682 | 추가: | |
| 683 | 추가: #[test] | |
| 684 | 추가: fn limits_are_clamped_and_do_not_overflow() { | |
| 685 | 추가: let budget = Budget::new(Limits { | |
| 686 | 추가: input: u64::MAX, | |
| 687 | 추가: processed: u64::MAX, | |
| 688 | 추가: output: u64::MAX, | |
| 689 | 추가: metadata: u64::MAX, | |
| 690 | 추가: duration: std::time::Duration::MAX, | |
| 691 | 추가: }) | |
| 692 | 추가: .unwrap(); | |
| 693 | 추가: let limits = budget.limits(); | |
| 694 | 추가: assert_eq!(limits.input, 16 * 1024 * 1024); | |
| 695 | 추가: assert_eq!(limits.processed, 128 * 1024 * 1024); | |
| 696 | 추가: assert_eq!(limits.output, 16 * 1024 * 1024); | |
| 697 | 추가: assert_eq!(limits.metadata, 1024 * 1024); | |
| 698 | 추가: assert_eq!(limits.duration, std::time::Duration::from_secs(300)); | |
| 699 | 추가: assert_eq!(budget.usage(), Usage::default()); | |
| 700 | 추가: } | |
| 701 | 추가: | |
| 702 | 추가: #[test] | |
| 703 | 추가: fn zero_duration_is_invalid() { | |
| 704 | 추가: assert!(matches!( | |
| 705 | 추가: Budget::new(Limits { | |
| 706 | 추가: duration: std::time::Duration::ZERO, | |
| 707 | 추가: ..Limits::default() | |
| 708 | 추가: }), | |
| 709 | 추가: Err(Failure::InvalidRequest) | |
| 710 | 추가: )); | |
| 711 | 추가: } | |
| 712 | 추가: | |
| 713 | 추가: #[test] | |
| 714 | 추가: fn zero_byte_limits_are_valid_requests() { | |
| 715 | 추가: let budget = Budget::new(Limits { | |
| 716 | 추가: input: 0, | |
| 717 | 추가: processed: 0, | |
| 718 | 추가: output: 0, | |
| 719 | 추가: metadata: 0, | |
| 720 | 추가: ..Limits::default() | |
| 721 | 추가: }) | |
| 722 | 추가: .unwrap(); | |
| 723 | 추가: assert_eq!(budget.usage(), Usage::default()); | |
| 724 | 추가: } | |
| 725 | 추가: | |
| 726 | 추가: #[test] | |
| 727 | 추가: fn output_failure_is_not_refunded_by_retry() { | |
| 728 | 추가: let mut budget = Budget::new(limit(Field::Output, 8)).unwrap(); | |
| 729 | 추가: for attempt in 1..=2 { | |
| 730 | 추가: reader_error(read(&normal(), true, &mut budget), Failure::Budget); | |
| 731 | 추가: assert_eq!( | |
| 732 | 추가: budget.usage(), | |
| 733 | 추가: Usage { | |
| 734 | 추가: processed: 38 * attempt, | |
| 735 | 추가: output: 0, | |
| 736 | 추가: metadata: 10 * attempt | |
| 737 | 추가: } | |
| 738 | 추가: ); | |
| 739 | 추가: } | |
| 740 | 추가: } | |
| 741 | 추가: | |
| 742 | 추가: #[test] | |
| 743 | 추가: fn unselected_expansion_is_charged() { | |
| 744 | 추가: let input = fixture("large_output"); | |
| 745 | 추가: let mut budget = Budget::new(limit(Field::Processed, input.len() as u64 + 65535)).unwrap(); | |
| 746 | 추가: reader_error(read(&input, false, &mut budget), Failure::Budget); | |
| 747 | 추가: assert_eq!( | |
| 748 | 추가: budget.usage(), | |
| 749 | 추가: Usage { | |
| 750 | 추가: processed: input.len() as u64 + 65536, | |
| 751 | 추가: output: 0, | |
| 752 | 추가: metadata: 10 | |
| 753 | 추가: } | |
| 754 | 추가: ); | |
| 755 | 추가: } | |
| 756 | 추가: | |
| 757 | 추가: #[test] | |
| 758 | 추가: fn selected_large_output_limit_precedes_later_chunks() { | |
| 759 | 추가: let input = fixture("large_output"); | |
| 760 | 추가: let mut budget = Budget::new(limit(Field::Output, 65535)).unwrap(); | |
| 761 | 추가: reader_error(read(&input, true, &mut budget), Failure::Budget); | |
| 762 | 추가: assert_eq!( | |
| 763 | 추가: budget.usage(), | |
| 764 | 추가: Usage { | |
| 765 | 추가: processed: input.len() as u64 + 65536, | |
| 766 | 추가: output: 0, | |
| 767 | 추가: metadata: 10 | |
| 768 | 추가: } | |
| 769 | 추가: ); | |
| 770 | 추가: } | |
| 771 | 추가: | |
| 772 | 추가: #[test] | |
| 773 | 추가: fn failed_header_retry_keeps_attempt_metadata() { | |
| 774 | 추가: let mut budget = Budget::new(limit(Field::Metadata, 1)).unwrap(); | |
| 775 | 추가: reader_error(read(&[], false, &mut budget), Failure::Truncated); | |
| 776 | 추가: reader_error(read(&[], false, &mut budget), Failure::Budget); | |
| 777 | 추가: assert_eq!( | |
| 778 | 추가: budget.usage(), | |
| 779 | 추가: Usage { | |
| 780 | 추가: processed: 0, | |
| 781 | 추가: output: 0, | |
| 782 | 추가: metadata: 1 | |
| 783 | 추가: } | |
| 784 | 추가: ); | |
| 785 | 추가: } |
| @@ -0,0 +1,546 @@ | ||
| 1 | 추가: use crate::support::*; | |
| 2 | 추가: use std::sync::Arc; | |
| 3 | 추가: use std::time::Duration; | |
| 4 | 추가: use zipelo_memory_gzip_reader::{Budget, Error, Failure, Limits, Stage, Stop, Usage}; | |
| 5 | 추가: | |
| 6 | 추가: #[derive(Clone, Copy)] | |
| 7 | 추가: enum Action { | |
| 8 | 추가: Cancel, | |
| 9 | 추가: Deadline, | |
| 10 | 추가: Callback, | |
| 11 | 추가: } | |
| 12 | 추가: | |
| 13 | 추가: fn stop_at(stage: Stage, action: Action, selected: bool) { | |
| 14 | 추가: let marker = Arc::new(String::from("원형 오류")); | |
| 15 | 추가: let original = marker.clone(); | |
| 16 | 추가: let mut fired = false; | |
| 17 | 추가: let mut budget = budget(); | |
| 18 | 추가: let result = | |
| 19 | 추가: zipelo_memory_gzip_reader::read(request(&normal(), selected), &mut budget, |point| { | |
| 20 | 추가: assert!(!fired, "오류 이후 checkpoint가 호출되면 안 됨"); | |
| 21 | 추가: if point.stage == stage { | |
| 22 | 추가: fired = true; | |
| 23 | 추가: return Err(match action { | |
| 24 | 추가: Action::Cancel => Stop::Cancelled, | |
| 25 | 추가: Action::Deadline => Stop::Deadline, | |
| 26 | 추가: Action::Callback => Stop::Callback(marker.clone()), | |
| 27 | 추가: }); | |
| 28 | 추가: } | |
| 29 | 추가: Ok(()) | |
| 30 | 추가: }); | |
| 31 | 추가: assert!(fired, "{stage:?}에 도달해야 함"); | |
| 32 | 추가: match action { | |
| 33 | 추가: Action::Cancel => reader_error(result, Failure::Cancelled), | |
| 34 | 추가: Action::Deadline => reader_error(result, Failure::Budget), | |
| 35 | 추가: Action::Callback => match result { | |
| 36 | 추가: Err(Error::Callback(error)) => assert!(Arc::ptr_eq(&original, &error)), | |
| 37 | 추가: other => panic!("콜백 오류 원형이어야 함: {other:?}"), | |
| 38 | 추가: }, | |
| 39 | 추가: } | |
| 40 | 추가: let expected = match stage { | |
| 41 | 추가: Stage::Start | Stage::Header => Usage::default(), | |
| 42 | 추가: Stage::BeforeInflate => Usage { | |
| 43 | 추가: processed: 10, | |
| 44 | 추가: output: 0, | |
| 45 | 추가: metadata: 10, | |
| 46 | 추가: }, | |
| 47 | 추가: Stage::AfterInflate => Usage { | |
| 48 | 추가: processed: 38, | |
| 49 | 추가: output: 0, | |
| 50 | 추가: metadata: 10, | |
| 51 | 추가: }, | |
| 52 | 추가: Stage::AfterOutput | Stage::Trailer | Stage::BeforeReturn => Usage { | |
| 53 | 추가: processed: 38, | |
| 54 | 추가: output: if selected { 9 } else { 0 }, | |
| 55 | 추가: metadata: 10, | |
| 56 | 추가: }, | |
| 57 | 추가: }; | |
| 58 | 추가: assert_eq!(budget.usage(), expected); | |
| 59 | 추가: } | |
| 60 | 추가: | |
| 61 | 추가: #[test] | |
| 62 | 추가: fn start_cancel_selected() { | |
| 63 | 추가: stop_at(Stage::Start, Action::Cancel, true); | |
| 64 | 추가: } | |
| 65 | 추가: | |
| 66 | 추가: #[test] | |
| 67 | 추가: fn start_deadline_selected() { | |
| 68 | 추가: stop_at(Stage::Start, Action::Deadline, true); | |
| 69 | 추가: } | |
| 70 | 추가: | |
| 71 | 추가: #[test] | |
| 72 | 추가: fn start_callback_selected() { | |
| 73 | 추가: stop_at(Stage::Start, Action::Callback, true); | |
| 74 | 추가: } | |
| 75 | 추가: | |
| 76 | 추가: #[test] | |
| 77 | 추가: fn header_cancel_selected() { | |
| 78 | 추가: stop_at(Stage::Header, Action::Cancel, true); | |
| 79 | 추가: } | |
| 80 | 추가: | |
| 81 | 추가: #[test] | |
| 82 | 추가: fn header_deadline_selected() { | |
| 83 | 추가: stop_at(Stage::Header, Action::Deadline, true); | |
| 84 | 추가: } | |
| 85 | 추가: | |
| 86 | 추가: #[test] | |
| 87 | 추가: fn header_callback_selected() { | |
| 88 | 추가: stop_at(Stage::Header, Action::Callback, true); | |
| 89 | 추가: } | |
| 90 | 추가: | |
| 91 | 추가: #[test] | |
| 92 | 추가: fn before_inflate_cancel_selected() { | |
| 93 | 추가: stop_at(Stage::BeforeInflate, Action::Cancel, true); | |
| 94 | 추가: } | |
| 95 | 추가: | |
| 96 | 추가: #[test] | |
| 97 | 추가: fn before_inflate_deadline_selected() { | |
| 98 | 추가: stop_at(Stage::BeforeInflate, Action::Deadline, true); | |
| 99 | 추가: } | |
| 100 | 추가: | |
| 101 | 추가: #[test] | |
| 102 | 추가: fn before_inflate_callback_selected() { | |
| 103 | 추가: stop_at(Stage::BeforeInflate, Action::Callback, true); | |
| 104 | 추가: } | |
| 105 | 추가: | |
| 106 | 추가: #[test] | |
| 107 | 추가: fn after_inflate_cancel_selected() { | |
| 108 | 추가: stop_at(Stage::AfterInflate, Action::Cancel, true); | |
| 109 | 추가: } | |
| 110 | 추가: | |
| 111 | 추가: #[test] | |
| 112 | 추가: fn after_inflate_deadline_selected() { | |
| 113 | 추가: stop_at(Stage::AfterInflate, Action::Deadline, true); | |
| 114 | 추가: } | |
| 115 | 추가: | |
| 116 | 추가: #[test] | |
| 117 | 추가: fn after_inflate_callback_selected() { | |
| 118 | 추가: stop_at(Stage::AfterInflate, Action::Callback, true); | |
| 119 | 추가: } | |
| 120 | 추가: | |
| 121 | 추가: #[test] | |
| 122 | 추가: fn after_output_cancel_selected() { | |
| 123 | 추가: stop_at(Stage::AfterOutput, Action::Cancel, true); | |
| 124 | 추가: } | |
| 125 | 추가: | |
| 126 | 추가: #[test] | |
| 127 | 추가: fn after_output_deadline_selected() { | |
| 128 | 추가: stop_at(Stage::AfterOutput, Action::Deadline, true); | |
| 129 | 추가: } | |
| 130 | 추가: | |
| 131 | 추가: #[test] | |
| 132 | 추가: fn after_output_callback_selected() { | |
| 133 | 추가: stop_at(Stage::AfterOutput, Action::Callback, true); | |
| 134 | 추가: } | |
| 135 | 추가: | |
| 136 | 추가: #[test] | |
| 137 | 추가: fn trailer_cancel_selected() { | |
| 138 | 추가: stop_at(Stage::Trailer, Action::Cancel, true); | |
| 139 | 추가: } | |
| 140 | 추가: | |
| 141 | 추가: #[test] | |
| 142 | 추가: fn trailer_deadline_selected() { | |
| 143 | 추가: stop_at(Stage::Trailer, Action::Deadline, true); | |
| 144 | 추가: } | |
| 145 | 추가: | |
| 146 | 추가: #[test] | |
| 147 | 추가: fn trailer_callback_selected() { | |
| 148 | 추가: stop_at(Stage::Trailer, Action::Callback, true); | |
| 149 | 추가: } | |
| 150 | 추가: | |
| 151 | 추가: #[test] | |
| 152 | 추가: fn before_return_cancel_selected() { | |
| 153 | 추가: stop_at(Stage::BeforeReturn, Action::Cancel, true); | |
| 154 | 추가: } | |
| 155 | 추가: | |
| 156 | 추가: #[test] | |
| 157 | 추가: fn before_return_deadline_selected() { | |
| 158 | 추가: stop_at(Stage::BeforeReturn, Action::Deadline, true); | |
| 159 | 추가: } | |
| 160 | 추가: | |
| 161 | 추가: #[test] | |
| 162 | 추가: fn before_return_callback_selected() { | |
| 163 | 추가: stop_at(Stage::BeforeReturn, Action::Callback, true); | |
| 164 | 추가: } | |
| 165 | 추가: | |
| 166 | 추가: #[test] | |
| 167 | 추가: fn after_inflate_cancel_precedes_trailer_failure_selected() { | |
| 168 | 추가: let mut input = normal(); | |
| 169 | 추가: input[21] ^= 1; | |
| 170 | 추가: let mut reached = false; | |
| 171 | 추가: let mut budget = budget(); | |
| 172 | 추가: let result = zipelo_memory_gzip_reader::read(request(&input, true), &mut budget, |point| { | |
| 173 | 추가: assert!(!reached); | |
| 174 | 추가: if point.stage == Stage::AfterInflate { | |
| 175 | 추가: reached = true; | |
| 176 | 추가: Err(Stop::<()>::Cancelled) | |
| 177 | 추가: } else { | |
| 178 | 추가: Ok(()) | |
| 179 | 추가: } | |
| 180 | 추가: }); | |
| 181 | 추가: assert!(reached); | |
| 182 | 추가: reader_error(result, Failure::Cancelled); | |
| 183 | 추가: assert_eq!( | |
| 184 | 추가: budget.usage(), | |
| 185 | 추가: Usage { | |
| 186 | 추가: processed: 38, | |
| 187 | 추가: output: 0, | |
| 188 | 추가: metadata: 10 | |
| 189 | 추가: } | |
| 190 | 추가: ); | |
| 191 | 추가: } | |
| 192 | 추가: #[test] | |
| 193 | 추가: fn successful_checkpoint_trace_selected() { | |
| 194 | 추가: let mut stages = Vec::new(); | |
| 195 | 추가: let mut previous = Usage::default(); | |
| 196 | 추가: let mut budget = budget(); | |
| 197 | 추가: let result = zipelo_memory_gzip_reader::read(request(&normal(), true), &mut budget, |point| { | |
| 198 | 추가: assert!(point.usage.processed >= previous.processed); | |
| 199 | 추가: assert!(point.usage.output >= previous.output); | |
| 200 | 추가: assert!(point.usage.metadata >= previous.metadata); | |
| 201 | 추가: previous = point.usage; | |
| 202 | 추가: stages.push(point.stage); | |
| 203 | 추가: Ok::<_, Stop<()>>(()) | |
| 204 | 추가: }) | |
| 205 | 추가: .unwrap(); | |
| 206 | 추가: assert_eq!(stages.first(), Some(&Stage::Start)); | |
| 207 | 추가: assert_eq!(stages.last(), Some(&Stage::BeforeReturn)); | |
| 208 | 추가: let before = stages | |
| 209 | 추가: .iter() | |
| 210 | 추가: .position(|s| *s == Stage::BeforeInflate) | |
| 211 | 추가: .unwrap(); | |
| 212 | 추가: let after = stages | |
| 213 | 추가: .iter() | |
| 214 | 추가: .position(|s| *s == Stage::AfterInflate) | |
| 215 | 추가: .unwrap(); | |
| 216 | 추가: let trailer = stages.iter().position(|s| *s == Stage::Trailer).unwrap(); | |
| 217 | 추가: assert!(before < after && after < trailer); | |
| 218 | 추가: assert_eq!( | |
| 219 | 추가: stages.iter().filter(|s| **s == Stage::AfterOutput).count(), | |
| 220 | 추가: 1 | |
| 221 | 추가: ); | |
| 222 | 추가: assert_eq!(previous, result.usage); | |
| 223 | 추가: } | |
| 224 | 추가: | |
| 225 | 추가: #[test] | |
| 226 | 추가: fn start_cancel_unselected() { | |
| 227 | 추가: stop_at(Stage::Start, Action::Cancel, false); | |
| 228 | 추가: } | |
| 229 | 추가: | |
| 230 | 추가: #[test] | |
| 231 | 추가: fn start_deadline_unselected() { | |
| 232 | 추가: stop_at(Stage::Start, Action::Deadline, false); | |
| 233 | 추가: } | |
| 234 | 추가: | |
| 235 | 추가: #[test] | |
| 236 | 추가: fn start_callback_unselected() { | |
| 237 | 추가: stop_at(Stage::Start, Action::Callback, false); | |
| 238 | 추가: } | |
| 239 | 추가: | |
| 240 | 추가: #[test] | |
| 241 | 추가: fn header_cancel_unselected() { | |
| 242 | 추가: stop_at(Stage::Header, Action::Cancel, false); | |
| 243 | 추가: } | |
| 244 | 추가: | |
| 245 | 추가: #[test] | |
| 246 | 추가: fn header_deadline_unselected() { | |
| 247 | 추가: stop_at(Stage::Header, Action::Deadline, false); | |
| 248 | 추가: } | |
| 249 | 추가: | |
| 250 | 추가: #[test] | |
| 251 | 추가: fn header_callback_unselected() { | |
| 252 | 추가: stop_at(Stage::Header, Action::Callback, false); | |
| 253 | 추가: } | |
| 254 | 추가: | |
| 255 | 추가: #[test] | |
| 256 | 추가: fn before_inflate_cancel_unselected() { | |
| 257 | 추가: stop_at(Stage::BeforeInflate, Action::Cancel, false); | |
| 258 | 추가: } | |
| 259 | 추가: | |
| 260 | 추가: #[test] | |
| 261 | 추가: fn before_inflate_deadline_unselected() { | |
| 262 | 추가: stop_at(Stage::BeforeInflate, Action::Deadline, false); | |
| 263 | 추가: } | |
| 264 | 추가: | |
| 265 | 추가: #[test] | |
| 266 | 추가: fn before_inflate_callback_unselected() { | |
| 267 | 추가: stop_at(Stage::BeforeInflate, Action::Callback, false); | |
| 268 | 추가: } | |
| 269 | 추가: | |
| 270 | 추가: #[test] | |
| 271 | 추가: fn after_inflate_cancel_unselected() { | |
| 272 | 추가: stop_at(Stage::AfterInflate, Action::Cancel, false); | |
| 273 | 추가: } | |
| 274 | 추가: | |
| 275 | 추가: #[test] | |
| 276 | 추가: fn after_inflate_deadline_unselected() { | |
| 277 | 추가: stop_at(Stage::AfterInflate, Action::Deadline, false); | |
| 278 | 추가: } | |
| 279 | 추가: | |
| 280 | 추가: #[test] | |
| 281 | 추가: fn after_inflate_callback_unselected() { | |
| 282 | 추가: stop_at(Stage::AfterInflate, Action::Callback, false); | |
| 283 | 추가: } | |
| 284 | 추가: | |
| 285 | 추가: #[test] | |
| 286 | 추가: fn trailer_cancel_unselected() { | |
| 287 | 추가: stop_at(Stage::Trailer, Action::Cancel, false); | |
| 288 | 추가: } | |
| 289 | 추가: | |
| 290 | 추가: #[test] | |
| 291 | 추가: fn trailer_deadline_unselected() { | |
| 292 | 추가: stop_at(Stage::Trailer, Action::Deadline, false); | |
| 293 | 추가: } | |
| 294 | 추가: | |
| 295 | 추가: #[test] | |
| 296 | 추가: fn trailer_callback_unselected() { | |
| 297 | 추가: stop_at(Stage::Trailer, Action::Callback, false); | |
| 298 | 추가: } | |
| 299 | 추가: | |
| 300 | 추가: #[test] | |
| 301 | 추가: fn before_return_cancel_unselected() { | |
| 302 | 추가: stop_at(Stage::BeforeReturn, Action::Cancel, false); | |
| 303 | 추가: } | |
| 304 | 추가: | |
| 305 | 추가: #[test] | |
| 306 | 추가: fn before_return_deadline_unselected() { | |
| 307 | 추가: stop_at(Stage::BeforeReturn, Action::Deadline, false); | |
| 308 | 추가: } | |
| 309 | 추가: | |
| 310 | 추가: #[test] | |
| 311 | 추가: fn before_return_callback_unselected() { | |
| 312 | 추가: stop_at(Stage::BeforeReturn, Action::Callback, false); | |
| 313 | 추가: } | |
| 314 | 추가: | |
| 315 | 추가: #[test] | |
| 316 | 추가: fn after_inflate_cancel_precedes_trailer_failure_unselected() { | |
| 317 | 추가: let mut input = normal(); | |
| 318 | 추가: input[21] ^= 1; | |
| 319 | 추가: let mut reached = false; | |
| 320 | 추가: let mut budget = budget(); | |
| 321 | 추가: let result = zipelo_memory_gzip_reader::read(request(&input, false), &mut budget, |point| { | |
| 322 | 추가: assert!(!reached); | |
| 323 | 추가: if point.stage == Stage::AfterInflate { | |
| 324 | 추가: reached = true; | |
| 325 | 추가: Err(Stop::<()>::Cancelled) | |
| 326 | 추가: } else { | |
| 327 | 추가: Ok(()) | |
| 328 | 추가: } | |
| 329 | 추가: }); | |
| 330 | 추가: assert!(reached); | |
| 331 | 추가: reader_error(result, Failure::Cancelled); | |
| 332 | 추가: assert_eq!( | |
| 333 | 추가: budget.usage(), | |
| 334 | 추가: Usage { | |
| 335 | 추가: processed: 38, | |
| 336 | 추가: output: 0, | |
| 337 | 추가: metadata: 10 | |
| 338 | 추가: } | |
| 339 | 추가: ); | |
| 340 | 추가: } | |
| 341 | 추가: #[test] | |
| 342 | 추가: fn successful_checkpoint_trace_unselected() { | |
| 343 | 추가: let mut stages = Vec::new(); | |
| 344 | 추가: let mut previous = Usage::default(); | |
| 345 | 추가: let mut budget = budget(); | |
| 346 | 추가: let result = zipelo_memory_gzip_reader::read(request(&normal(), false), &mut budget, |point| { | |
| 347 | 추가: assert!(point.usage.processed >= previous.processed); | |
| 348 | 추가: assert!(point.usage.output >= previous.output); | |
| 349 | 추가: assert!(point.usage.metadata >= previous.metadata); | |
| 350 | 추가: previous = point.usage; | |
| 351 | 추가: stages.push(point.stage); | |
| 352 | 추가: Ok::<_, Stop<()>>(()) | |
| 353 | 추가: }) | |
| 354 | 추가: .unwrap(); | |
| 355 | 추가: assert_eq!(stages.first(), Some(&Stage::Start)); | |
| 356 | 추가: assert_eq!(stages.last(), Some(&Stage::BeforeReturn)); | |
| 357 | 추가: let before = stages | |
| 358 | 추가: .iter() | |
| 359 | 추가: .position(|s| *s == Stage::BeforeInflate) | |
| 360 | 추가: .unwrap(); | |
| 361 | 추가: let after = stages | |
| 362 | 추가: .iter() | |
| 363 | 추가: .position(|s| *s == Stage::AfterInflate) | |
| 364 | 추가: .unwrap(); | |
| 365 | 추가: let trailer = stages.iter().position(|s| *s == Stage::Trailer).unwrap(); | |
| 366 | 추가: assert!(before < after && after < trailer); | |
| 367 | 추가: assert_eq!( | |
| 368 | 추가: stages.iter().filter(|s| **s == Stage::AfterOutput).count(), | |
| 369 | 추가: 0 | |
| 370 | 추가: ); | |
| 371 | 추가: assert_eq!(previous, result.usage); | |
| 372 | 추가: } | |
| 373 | 추가: | |
| 374 | 추가: #[test] | |
| 375 | 추가: fn output_chunks_are_bounded_and_complete() { | |
| 376 | 추가: let mut delivered = 0; | |
| 377 | 추가: let mut chunks = Vec::new(); | |
| 378 | 추가: let mut budget = budget(); | |
| 379 | 추가: let done = zipelo_memory_gzip_reader::read( | |
| 380 | 추가: request(&fixture("large_output"), true), | |
| 381 | 추가: &mut budget, | |
| 382 | 추가: |point| { | |
| 383 | 추가: if point.stage == Stage::AfterOutput { | |
| 384 | 추가: let delta = point.usage.output - delivered; | |
| 385 | 추가: assert!((1..=65536).contains(&delta)); | |
| 386 | 추가: chunks.push(delta); | |
| 387 | 추가: delivered = point.usage.output; | |
| 388 | 추가: } | |
| 389 | 추가: Ok::<_, Stop<()>>(()) | |
| 390 | 추가: }, | |
| 391 | 추가: ) | |
| 392 | 추가: .unwrap(); | |
| 393 | 추가: assert_eq!(chunks, vec![65536, 65536, 65536, 3395]); | |
| 394 | 추가: assert_eq!(done.bytes.unwrap(), vec![b'A'; 200003]); | |
| 395 | 추가: } | |
| 396 | 추가: | |
| 397 | 추가: #[test] | |
| 398 | 추가: fn unselected_never_exposes_after_output() { | |
| 399 | 추가: let mut budget = budget(); | |
| 400 | 추가: let mut inflated = 0; | |
| 401 | 추가: let done = zipelo_memory_gzip_reader::read( | |
| 402 | 추가: request(&fixture("large_output"), false), | |
| 403 | 추가: &mut budget, | |
| 404 | 추가: |point| { | |
| 405 | 추가: assert_ne!(point.stage, Stage::AfterOutput); | |
| 406 | 추가: if point.stage == Stage::AfterInflate { | |
| 407 | 추가: inflated += 1; | |
| 408 | 추가: } | |
| 409 | 추가: assert_eq!(point.usage.output, 0); | |
| 410 | 추가: Ok::<_, Stop<()>>(()) | |
| 411 | 추가: }, | |
| 412 | 추가: ) | |
| 413 | 추가: .unwrap(); | |
| 414 | 추가: assert!(inflated >= 4); | |
| 415 | 추가: assert_eq!(done.bytes, None); | |
| 416 | 추가: } | |
| 417 | 추가: | |
| 418 | 추가: #[test] | |
| 419 | 추가: fn empty_selected_never_calls_after_output() { | |
| 420 | 추가: let mut budget = budget(); | |
| 421 | 추가: let result = zipelo_memory_gzip_reader::read( | |
| 422 | 추가: request(&fixture("empty_fixed"), true), | |
| 423 | 추가: &mut budget, | |
| 424 | 추가: |point| { | |
| 425 | 추가: assert_ne!(point.stage, Stage::AfterOutput); | |
| 426 | 추가: Ok::<_, Stop<()>>(()) | |
| 427 | 추가: }, | |
| 428 | 추가: ) | |
| 429 | 추가: .unwrap(); | |
| 430 | 추가: assert_eq!(result.bytes, Some(Vec::new())); | |
| 431 | 추가: } | |
| 432 | 추가: | |
| 433 | 추가: #[test] | |
| 434 | 추가: fn output_failure_stops_later_callbacks() { | |
| 435 | 추가: let mut budget = Budget::new(Limits { | |
| 436 | 추가: output: 0, | |
| 437 | 추가: ..Limits::default() | |
| 438 | 추가: }) | |
| 439 | 추가: .unwrap(); | |
| 440 | 추가: let mut after_inflate = false; | |
| 441 | 추가: let result = zipelo_memory_gzip_reader::read(request(&normal(), true), &mut budget, |point| { | |
| 442 | 추가: assert!(!after_inflate); | |
| 443 | 추가: after_inflate = point.stage == Stage::AfterInflate; | |
| 444 | 추가: Ok::<_, Stop<()>>(()) | |
| 445 | 추가: }); | |
| 446 | 추가: assert!(after_inflate); | |
| 447 | 추가: reader_error(result, Failure::Budget); | |
| 448 | 추가: } | |
| 449 | 추가: | |
| 450 | 추가: #[test] | |
| 451 | 추가: fn cancellation_precedes_input_cap() { | |
| 452 | 추가: let mut budget = Budget::new(Limits { | |
| 453 | 추가: input: 0, | |
| 454 | 추가: ..Limits::default() | |
| 455 | 추가: }) | |
| 456 | 추가: .unwrap(); | |
| 457 | 추가: let result = zipelo_memory_gzip_reader::read(request(&normal(), true), &mut budget, |_| { | |
| 458 | 추가: Err(Stop::<()>::Cancelled) | |
| 459 | 추가: }); | |
| 460 | 추가: reader_error(result, Failure::Cancelled); | |
| 461 | 추가: assert_eq!(budget.usage(), Usage::default()); | |
| 462 | 추가: } | |
| 463 | 추가: | |
| 464 | 추가: #[test] | |
| 465 | 추가: fn cancellation_precedes_existing_processed_overrun() { | |
| 466 | 추가: let input = bad_after_output(); | |
| 467 | 추가: let mut budget = Budget::new(Limits { | |
| 468 | 추가: processed: input.len() as u64, | |
| 469 | 추가: ..Limits::default() | |
| 470 | 추가: }) | |
| 471 | 추가: .unwrap(); | |
| 472 | 추가: reader_error(read(&input, true, &mut budget), Failure::Budget); | |
| 473 | 추가: let before = budget.usage(); | |
| 474 | 추가: let result = zipelo_memory_gzip_reader::read(request(&normal(), true), &mut budget, |_| { | |
| 475 | 추가: Err(Stop::<()>::Cancelled) | |
| 476 | 추가: }); | |
| 477 | 추가: reader_error(result, Failure::Cancelled); | |
| 478 | 추가: assert_eq!(budget.usage(), before); | |
| 479 | 추가: } | |
| 480 | 추가: | |
| 481 | 추가: fn expired_callback(action: Option<Action>) { | |
| 482 | 추가: let marker = Arc::new(7); | |
| 483 | 추가: let mut budget = Budget::new(Limits { | |
| 484 | 추가: duration: Duration::from_millis(20), | |
| 485 | 추가: ..Limits::default() | |
| 486 | 추가: }) | |
| 487 | 추가: .unwrap(); | |
| 488 | 추가: let mut entered = false; | |
| 489 | 추가: let result = zipelo_memory_gzip_reader::read(request(&normal(), true), &mut budget, |point| { | |
| 490 | 추가: assert!(!entered); | |
| 491 | 추가: assert_eq!(point.stage, Stage::Start); | |
| 492 | 추가: entered = true; | |
| 493 | 추가: std::thread::sleep(Duration::from_millis(30)); | |
| 494 | 추가: match action { | |
| 495 | 추가: Some(Action::Cancel) => Err(Stop::Cancelled), | |
| 496 | 추가: Some(Action::Callback) => Err(Stop::Callback(marker.clone())), | |
| 497 | 추가: Some(Action::Deadline) => Err(Stop::Deadline), | |
| 498 | 추가: None => Ok(()), | |
| 499 | 추가: } | |
| 500 | 추가: }); | |
| 501 | 추가: assert!(entered); | |
| 502 | 추가: assert!(budget.elapsed() >= Duration::from_millis(20)); | |
| 503 | 추가: match action { | |
| 504 | 추가: Some(Action::Cancel) => reader_error(result, Failure::Cancelled), | |
| 505 | 추가: Some(Action::Callback) => match result { | |
| 506 | 추가: Err(Error::Callback(error)) => assert!(Arc::ptr_eq(&marker, &error)), | |
| 507 | 추가: other => panic!("콜백 원형이 유지되어야 함: {other:?}"), | |
| 508 | 추가: }, | |
| 509 | 추가: _ => reader_error(result, Failure::Budget), | |
| 510 | 추가: } | |
| 511 | 추가: assert_eq!(budget.usage(), Usage::default()); | |
| 512 | 추가: reader_error(read(&normal(), true, &mut budget), Failure::Budget); | |
| 513 | 추가: assert_eq!(budget.usage(), Usage::default()); | |
| 514 | 추가: } | |
| 515 | 추가: | |
| 516 | 추가: #[test] | |
| 517 | 추가: fn elapsed_deadline_after_callback_and_retry() { | |
| 518 | 추가: expired_callback(None); | |
| 519 | 추가: } | |
| 520 | 추가: | |
| 521 | 추가: #[test] | |
| 522 | 추가: fn cancelled_callback_precedes_elapsed_deadline() { | |
| 523 | 추가: expired_callback(Some(Action::Cancel)); | |
| 524 | 추가: } | |
| 525 | 추가: | |
| 526 | 추가: #[test] | |
| 527 | 추가: fn callback_identity_precedes_elapsed_deadline() { | |
| 528 | 추가: expired_callback(Some(Action::Callback)); | |
| 529 | 추가: } | |
| 530 | 추가: | |
| 531 | 추가: #[test] | |
| 532 | 추가: fn completed_usage_snapshot_is_not_mutated_by_retry() { | |
| 533 | 추가: let mut budget = budget(); | |
| 534 | 추가: let first = read(&normal(), true, &mut budget).unwrap(); | |
| 535 | 추가: read(&normal(), false, &mut budget).unwrap(); | |
| 536 | 추가: assert_eq!( | |
| 537 | 추가: first.usage, | |
| 538 | 추가: Usage { | |
| 539 | 추가: processed: 38, | |
| 540 | 추가: output: 9, | |
| 541 | 추가: metadata: 10 | |
| 542 | 추가: } | |
| 543 | 추가: ); | |
| 544 | 추가: assert_eq!(first.bytes, Some(b"123456789".to_vec())); | |
| 545 | 추가: assert_eq!(budget.usage().processed, 76); | |
| 546 | 추가: } |
| @@ -0,0 +1,659 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "schema_version": 1, | |
| 3 | 추가: "source_commit": "e1ffd7bbffc358b6e53358682a93bf3ce075e892", | |
| 4 | 추가: "source_pr": 40, | |
| 5 | 추가: "branch": "fix/rust-memory-gzip-regressions", | |
| 6 | 추가: "source_pins": [ | |
| 7 | 추가: { | |
| 8 | 추가: "path": "experiments/rust-memory-gzip-reader/contract.json", | |
| 9 | 추가: "sha256": "1346c0b6f0ce5221acb9aef5067b0169e08ea6752f4db41a8b9c36b10ef9b43b", | |
| 10 | 추가: "git_blob": "02729ca349d5629b1a9fcd7040441db2e2660065" | |
| 11 | 추가: }, | |
| 12 | 추가: { | |
| 13 | 추가: "path": "experiments/rust-memory-gzip-reader/dependencies.json", | |
| 14 | 추가: "sha256": "3f71220451f8cd55dafdb6e6ae901572ec7bbe1be9c93d78953b44244aec6b07", | |
| 15 | 추가: "git_blob": "bf9da9b737d9d574d5e31fb8343f844b61e4c192" | |
| 16 | 추가: }, | |
| 17 | 추가: { | |
| 18 | 추가: "path": "experiments/rust-memory-gzip-reader/LICENSE", | |
| 19 | 추가: "sha256": "0714945e52a4d5b560c02c9a18478519f8c4e2572cbf87bd6d52adcfb2b63c62", | |
| 20 | 추가: "git_blob": "5014abac33298592fd3450b51a9b414191e1aabc" | |
| 21 | 추가: }, | |
| 22 | 추가: { | |
| 23 | 추가: "path": "experiments/rust-memory-gzip-reader/Cargo.toml", | |
| 24 | 추가: "sha256": "ae76aededbb85cdd6c9227b4c06a1c8fef1bb7f203f1703e787b68f30ccfab6a", | |
| 25 | 추가: "git_blob": "1b1b77e23d39cde1f05e55f73b62f68cf77dd9c6" | |
| 26 | 추가: }, | |
| 27 | 추가: { | |
| 28 | 추가: "path": "experiments/rust-memory-gzip-reader/SHA256SUMS", | |
| 29 | 추가: "sha256": "13e41e7d8ce2442cd8d93b1229211a5257e0568acc3466d5f9ec37f03c72a736", | |
| 30 | 추가: "git_blob": "e248c4827c2fb2e82a5e92f80deb0d744209c65c" | |
| 31 | 추가: }, | |
| 32 | 추가: { | |
| 33 | 추가: "path": "experiments/rust-memory-gzip-reader/Cargo.lock", | |
| 34 | 추가: "sha256": "511197f27b89d37c86f82ae1e8dda4229a3e5082ede9274efe8480df6e650d24", | |
| 35 | 추가: "git_blob": "a638f9b00ea1d76a99ccd93ea465ef9df4163c7a" | |
| 36 | 추가: }, | |
| 37 | 추가: { | |
| 38 | 추가: "path": "experiments/rust-memory-gzip-reader/THIRD-PARTY-NOTICES.txt", | |
| 39 | 추가: "sha256": "655ad3bee8c41a593c2b00cbb0a12be11e7246c41dda00319c223dd3f904910e", | |
| 40 | 추가: "git_blob": "f56aa8d736e78465701ac62fa5ad26d4d7dc05c9" | |
| 41 | 추가: }, | |
| 42 | 추가: { | |
| 43 | 추가: "path": "experiments/rust-memory-gzip-reader/src/lib.rs", | |
| 44 | 추가: "sha256": "a865a114fdb9d79b66226387b9f0e3fa601aad29cfe65ab443c946d6cbd74062", | |
| 45 | 추가: "git_blob": "1811dfc7ec0917da607727e7942b5a268ac7330a" | |
| 46 | 추가: }, | |
| 47 | 추가: { | |
| 48 | 추가: "path": "experiments/rust-memory-gzip-reader/src/budget.rs", | |
| 49 | 추가: "sha256": "b0d0b891a048712baba2038b8439d809a0359638f390b806f88496733753d61c", | |
| 50 | 추가: "git_blob": "0fa6fd1cdb541896540b7003168e5db71c11cb4b" | |
| 51 | 추가: } | |
| 52 | 추가: ], | |
| 53 | 추가: "baseline": { | |
| 54 | 추가: "commit": "f56324c98468076c57e18255ac1661a66fe26f84", | |
| 55 | 추가: "pr": 18, | |
| 56 | 추가: "reported_historical_counts": { | |
| 57 | 추가: "baseline": 184, | |
| 58 | 추가: "followup": 162 | |
| 59 | 추가: }, | |
| 60 | 추가: "note": "C# 기준 수이며 새 Rust 발견/실행/통과 수가 아님. 아래 적용 분류는 사례군 단위이며 346개와 일대일 대응 수를 주장하지 않음.", | |
| 61 | 추가: "pins": [ | |
| 62 | 추가: { | |
| 63 | 추가: "path": "tests/gzip-boundary-probe/Program.cs", | |
| 64 | 추가: "sha256": "f6ca5d16d1036514c704b4065bf20c38878c6508744d8f468d339ee0c9c17aef", | |
| 65 | 추가: "git_blob": "5ad9c6ba629f36032f2cc163b71a14eca86b041e" | |
| 66 | 추가: }, | |
| 67 | 추가: { | |
| 68 | 추가: "path": "tests/gzip-history-integration-probe/BoundaryProbe.cs", | |
| 69 | 추가: "sha256": "73c251e2370b24b724dd0719e09fff4d26c780d8d81b09b054ff4b69bbb96933", | |
| 70 | 추가: "git_blob": "b8ac8c447611da941f7b678e5d8b1fff297f4380" | |
| 71 | 추가: }, | |
| 72 | 추가: { | |
| 73 | 추가: "path": "tests/gzip-history-integration-probe/BudgetRegression.cs", | |
| 74 | 추가: "sha256": "3fad50415e8847f48e4aaa646379b663662de106dc6e9df080bd1c86d8a85997", | |
| 75 | 추가: "git_blob": "31dcd37d280722e56a6bacb99f8978615b0f67cd" | |
| 76 | 추가: }, | |
| 77 | 추가: { | |
| 78 | 추가: "path": "tests/gzip-history-integration-probe/FinalizationRegression.cs", | |
| 79 | 추가: "sha256": "cdf260b8183ab30c38cec3c081efe95c2f80cf8eaf1095c31a6035eee2493624", | |
| 80 | 추가: "git_blob": "f70864627541314440cc7fe413c2e91528c63e7b" | |
| 81 | 추가: }, | |
| 82 | 추가: { | |
| 83 | 추가: "path": "tests/gzip-history-integration-probe/IntegrationProgram.cs", | |
| 84 | 추가: "sha256": "bc106c5a1bd652d1067976c243507664987d38710737b3ce04c8444a4d36087a", | |
| 85 | 추가: "git_blob": "16b7d1e36267ee881916e620126a77cd48806bc5" | |
| 86 | 추가: }, | |
| 87 | 추가: { | |
| 88 | 추가: "path": "tests/gzip-history-integration-probe/PendingValidation.cs", | |
| 89 | 추가: "sha256": "7142648c4257854298a1fb71b0a1779f09bd1667bab4ff262a0d47ab48f805e2", | |
| 90 | 추가: "git_blob": "3160f5ca588f9093932606a7096786bc4468a1f0" | |
| 91 | 추가: }, | |
| 92 | 추가: { | |
| 93 | 추가: "path": "tests/gzip-history-integration-probe/contract.json", | |
| 94 | 추가: "sha256": "94bc3e2eb31dcd1c9931ef5e764a9ca28e508c1ea9ae7acdbd4fc1de8c5e48fa", | |
| 95 | 추가: "git_blob": "035ff86220f862396336cee8aa4fb2724115ba49" | |
| 96 | 추가: } | |
| 97 | 추가: ] | |
| 98 | 추가: }, | |
| 99 | 추가: "applicability": [ | |
| 100 | 추가: { | |
| 101 | 추가: "status": "maintained", | |
| 102 | 추가: "csharp": "header.flags.0..31; unselected.flags.0..31", | |
| 103 | 추가: "rust_prefixes": [ | |
| 104 | 추가: "format::flags_" | |
| 105 | 추가: ], | |
| 106 | 추가: "note": "32가지 flag 각각 선택/미선택 정상 완료와 전체 bytes 및 경계를 검증함." | |
| 107 | 추가: }, | |
| 108 | 추가: { | |
| 109 | 추가: "status": "maintained", | |
| 110 | 추가: "csharp": "header.invalid.*, header.reserved.*", | |
| 111 | 추가: "rust_prefixes": [ | |
| 112 | 추가: "format::invalid_header_", | |
| 113 | 추가: "format::reserved_flag_" | |
| 114 | 추가: ], | |
| 115 | 추가: "note": "magic/CM/예약 비트를 구분함." | |
| 116 | 추가: }, | |
| 117 | 추가: { | |
| 118 | 추가: "status": "maintained", | |
| 119 | 추가: "csharp": "header.fhcrc; header.fhcrc-covers-name", | |
| 120 | 추가: "rust_prefixes": [ | |
| 121 | 추가: "format::fhcrc_corrupt_" | |
| 122 | 추가: ], | |
| 123 | 추가: "note": "FHCRC 두 바이트와 이름 변조를 거부함." | |
| 124 | 추가: }, | |
| 125 | 추가: { | |
| 126 | 추가: "status": "maintained", | |
| 127 | 추가: "csharp": "header.fname-no-path-use", | |
| 128 | 추가: "rust_prefixes": [ | |
| 129 | 추가: "format::opaque_name_", | |
| 130 | 추가: "format::flags_08_" | |
| 131 | 추가: ], | |
| 132 | 추가: "note": "이름/주석은 경로 또는 UTF-8 문자열로 사용하지 않음." | |
| 133 | 추가: }, | |
| 134 | 추가: { | |
| 135 | 추가: "status": "maintained", | |
| 136 | 추가: "csharp": "header.unterminated-name/comment; extra-truncated; truncate.*; unselected.all-prefixes", | |
| 137 | 추가: "rust_prefixes": [ | |
| 138 | 추가: "format::truncate_" | |
| 139 | 추가: ], | |
| 140 | 추가: "note": "32가지 fixture의 모든 prefix를 선택/미선택으로 검사함. prefix 루프를 별도 시험 수로 합산하지 않음." | |
| 141 | 추가: }, | |
| 142 | 추가: { | |
| 143 | 추가: "status": "maintained", | |
| 144 | 추가: "csharp": "crc.byte.*; isize.byte.*; unselected.bad-crc", | |
| 145 | 추가: "rust_prefixes": [ | |
| 146 | 추가: "format::invalid_crc_", | |
| 147 | 추가: "format::invalid_size_", | |
| 148 | 추가: "format::crc_before_", | |
| 149 | 추가: "format::size_before_" | |
| 150 | 추가: ], | |
| 151 | 추가: "note": "CRC, Size, TrailingData 우선순위를 유지함." | |
| 152 | 추가: }, | |
| 153 | 추가: { | |
| 154 | 추가: "status": "maintained", | |
| 155 | 추가: "csharp": "trailing.*; unselected.trailing", | |
| 156 | 추가: "rust_prefixes": [ | |
| 157 | 추가: "format::trailing_" | |
| 158 | 추가: ], | |
| 159 | 추가: "note": "후행 0/255/512개 0/magic/정상 member/빈 member를 거부함." | |
| 160 | 추가: }, | |
| 161 | 추가: { | |
| 162 | 추가: "status": "maintained", | |
| 163 | 추가: "csharp": "empty.raw.2; empty.raw.5; empty.fixture.raw-boundary-hash; valid-three-zero-bytes", | |
| 164 | 추가: "rust_prefixes": [ | |
| 165 | 추가: "format::empty_fixed_", | |
| 166 | 추가: "format::empty_stored_", | |
| 167 | 추가: "format::zeros_three_" | |
| 168 | 추가: ], | |
| 169 | 추가: "note": "독립 known bytes로 빈 payload와 알려진 해제 결과를 비교함." | |
| 170 | 추가: }, | |
| 171 | 추가: { | |
| 172 | 추가: "status": "adapted", | |
| 173 | 추가: "csharp": "crc.known-vector; crc.known-trailer; HashSink", | |
| 174 | 추가: "rust_prefixes": [ | |
| 175 | 추가: "format::flags_00_" | |
| 176 | 추가: ], | |
| 177 | 추가: "note": "CRC 0xcbf43926과 완료 bytes 직접 일치를 검증함. SHA256은 Python fixture manifest에 고정하며 Rust SHA 구현을 추가하지 않음." | |
| 178 | 추가: }, | |
| 179 | 추가: { | |
| 180 | 추가: "status": "adapted", | |
| 181 | 추가: "csharp": "valid.{len}.{feed}; unselected.{len}; valid.controls", | |
| 182 | 추가: "rust_prefixes": [ | |
| 183 | 추가: "format::large_output_", | |
| 184 | 추가: "format::multiple_input_", | |
| 185 | 추가: "format::byte_a_" | |
| 186 | 추가: ], | |
| 187 | 추가: "note": "feed 인수가 없어 개별 feed 크기 조합을 그대로 이식하지 않음." | |
| 188 | 추가: }, | |
| 189 | 추가: { | |
| 190 | 추가: "status": "adapted", | |
| 191 | 추가: "csharp": "boundary.stored-chunks; boundary.readahead; boundary.byte-feed; raw.finished-consumed-unread", | |
| 192 | 추가: "rust_prefixes": [ | |
| 193 | 추가: "format::read_ahead_", | |
| 194 | 추가: "checkpoints::output_chunks_", | |
| 195 | 추가: "format::multiple_input_" | |
| 196 | 추가: ], | |
| 197 | 추가: "note": "공개 Boundary와 64KiB 출력/다중 공급 결과만 검증함. 내부 inflater 호출 위치나 빈 입력 drain 발생 자체는 증명하지 않음." | |
| 198 | 추가: }, | |
| 199 | 추가: { | |
| 200 | 추가: "status": "adapted", | |
| 201 | 추가: "csharp": "deflate.invalid-block; accounting.decoder-exception", | |
| 202 | 추가: "rust_prefixes": [ | |
| 203 | 추가: "format::reserved_deflate_", | |
| 204 | 추가: "budgets::backend_error_" | |
| 205 | 추가: ], | |
| 206 | 추가: "note": "typed Backend(DataError)와 오류 전 출력 1바이트 과금, 후속 checkpoint 부재를 검증함." | |
| 207 | 추가: }, | |
| 208 | 추가: { | |
| 209 | 추가: "status": "adapted", | |
| 210 | 추가: "csharp": "accounting.exception-over-limit", | |
| 211 | 추가: "rust_prefixes": [ | |
| 212 | 추가: "budgets::output_overrun_" | |
| 213 | 추가: ], | |
| 214 | 추가: "note": "유효 출력 과금 초과가 backend 오류보다 우선하고 비용이 재시도에 남음." | |
| 215 | 추가: }, | |
| 216 | 추가: { | |
| 217 | 추가: "status": "maintained", | |
| 218 | 추가: "csharp": "budget.input/processed/output/metadata; budget.exact; byte zero limits", | |
| 219 | 추가: "rust_prefixes": [ | |
| 220 | 추가: "budgets::input_", | |
| 221 | 추가: "budgets::processed_", | |
| 222 | 추가: "budgets::output_", | |
| 223 | 추가: "budgets::metadata_", | |
| 224 | 추가: "budgets::exact_all_", | |
| 225 | 추가: "budgets::zero_", | |
| 226 | 추가: "budgets::selected_empty_" | |
| 227 | 추가: ], | |
| 228 | 추가: "note": "0/정확값/1부족 및 선택 여부에 따른 output 의미를 구분함." | |
| 229 | 추가: }, | |
| 230 | 추가: { | |
| 231 | 추가: "status": "adapted", | |
| 232 | 추가: "csharp": "budget.clamps; budget.input-cap; budget.metadata-cap", | |
| 233 | 추가: "rust_prefixes": [ | |
| 234 | 추가: "budgets::limits_are_" | |
| 235 | 추가: ], | |
| 236 | 추가: "note": "하드 캡의 공개 limits() 값을 검증함. 16MiB 초과 입력이나 1MiB 이름은 이 작은 fixture 범위에서 동적 시험하지 않음." | |
| 237 | 추가: }, | |
| 238 | 추가: { | |
| 239 | 추가: "status": "maintained", | |
| 240 | 추가: "csharp": "budget.cumulative-processed/output/metadata; cumulative.processed", | |
| 241 | 추가: "rust_prefixes": [ | |
| 242 | 추가: "budgets::cumulative_", | |
| 243 | 추가: "budgets::shared_budget_", | |
| 244 | 추가: "budgets::crc_failure_" | |
| 245 | 추가: ], | |
| 246 | 추가: "note": "동일 Budget의 성공/실패/재시도 누적을 검증함." | |
| 247 | 추가: }, | |
| 248 | 추가: { | |
| 249 | 추가: "status": "maintained", | |
| 250 | 추가: "csharp": "budget.unselected-expansion", | |
| 251 | 추가: "rust_prefixes": [ | |
| 252 | 추가: "budgets::unselected_expansion_" | |
| 253 | 추가: ], | |
| 254 | 추가: "note": "비선택 해제 bytes도 처리량에 과금함." | |
| 255 | 추가: }, | |
| 256 | 추가: { | |
| 257 | 추가: "status": "adapted", | |
| 258 | 추가: "csharp": "budget.deadline; budget.sink-time; cumulative.time", | |
| 259 | 추가: "rust_prefixes": [ | |
| 260 | 추가: "checkpoints::elapsed_deadline_" | |
| 261 | 추가: ], | |
| 262 | 추가: "note": "ManualClock 대신 짧은 실제 Start callback 대기와 동일 Budget 재시도를 검사함. 실시간 강제 중단 보장은 아님." | |
| 263 | 추가: }, | |
| 264 | 추가: { | |
| 265 | 추가: "status": "adapted", | |
| 266 | 추가: "csharp": "cancel.before/sink/unselected-inflater; accounting.return-cancel/deadline", | |
| 267 | 추가: "rust_prefixes": [ | |
| 268 | 추가: "checkpoints::start_", | |
| 269 | 추가: "checkpoints::after_inflate_", | |
| 270 | 추가: "checkpoints::after_output_", | |
| 271 | 추가: "checkpoints::cancelled_callback_" | |
| 272 | 추가: ], | |
| 273 | 추가: "note": "public checkpoint의 취소/기한과 과금 순서를 검증함. C# polling 횟수 동등성 주장은 하지 않음." | |
| 274 | 추가: }, | |
| 275 | 추가: { | |
| 276 | 추가: "status": "adapted", | |
| 277 | 추가: "csharp": "sink.exception; accounting.other-exception; pending.output-failure", | |
| 278 | 추가: "rust_prefixes": [ | |
| 279 | 추가: "checkpoints::before_return_callback_", | |
| 280 | 추가: "checkpoints::callback_identity_" | |
| 281 | 추가: ], | |
| 282 | 추가: "note": "sink 원형 예외는 generic callback E의 Arc 포인터 동일성으로 대체함." | |
| 283 | 추가: }, | |
| 284 | 추가: { | |
| 285 | 추가: "status": "adapted", | |
| 286 | 추가: "csharp": "final.cancel/deadline; failure.discard; pending.output-cancel; sink.pending-after-crc-failure", | |
| 287 | 추가: "rust_prefixes": [ | |
| 288 | 추가: "checkpoints::before_return_", | |
| 289 | 추가: "format::invalid_crc_", | |
| 290 | 추가: "budgets::crc_failure_" | |
| 291 | 추가: ], | |
| 292 | 추가: "note": "오류가 Result::Err이고 Completed를 반환하지 않으며 실패 비용이 보존됨." | |
| 293 | 추가: }, | |
| 294 | 추가: { | |
| 295 | 추가: "status": "not_applicable", | |
| 296 | 추가: "csharp": "assembly.identity; CLI; mutable backing array; Pending wrapper reuse", | |
| 297 | 추가: "rust_prefixes": [], | |
| 298 | 추가: "note": "Rust Box 소유권과 최종 메모리 결과 API에 해당 seam이 없음." | |
| 299 | 추가: }, | |
| 300 | 추가: { | |
| 301 | 추가: "status": "not_applicable", | |
| 302 | 추가: "csharp": "FinalizationRegression Dispose scenarios", | |
| 303 | 추가: "rust_prefixes": [], | |
| 304 | 추가: "note": "외부 Dispose 예외가 본문 오류를 덮는 C# 동작을 Rust Drop으로 동일 검증할 수 없음." | |
| 305 | 추가: }, | |
| 306 | 추가: { | |
| 307 | 추가: "status": "not_applicable", | |
| 308 | 추가: "csharp": "inflater.contract-violation; FinalizationRegression TotalOut delta scenarios", | |
| 309 | 추가: "rust_prefixes": [], | |
| 310 | 추가: "note": "외부 카운터 변조가 불가능함. Boundary/overflow 분기를 위해 hook/unsafe를 추가하지 않음." | |
| 311 | 추가: }, | |
| 312 | 추가: { | |
| 313 | 추가: "status": "not_applicable", | |
| 314 | 추가: "csharp": "inflater.no-progress injected StalledInflater", | |
| 315 | 추가: "rust_prefixes": [], | |
| 316 | 추가: "note": "고정 typed backend에 stalled inflater를 주입할 수 없음. 실제 NoProgress 도달 증거가 없으며 성공으로 세지 않음." | |
| 317 | 추가: }, | |
| 318 | 추가: { | |
| 319 | 추가: "status": "not_applicable", | |
| 320 | 추가: "csharp": "deflate.invalid-backreference-history separate exact-history scenario", | |
| 321 | 추가: "rust_prefixes": [], | |
| 322 | 추가: "note": "기존 C# 근거는 유지하지만 이번에는 별도 Huffman/history 프로브를 재시도하지 않음. DataError 전체 동등성을 주장하지 않음." | |
| 323 | 추가: } | |
| 324 | 추가: ], | |
| 325 | 추가: "validation": { | |
| 326 | 추가: "scope": "source_only", | |
| 327 | 추가: "rust_compiled": false, | |
| 328 | 추가: "runtime_discovered": null, | |
| 329 | 추가: "runtime_executed": 0, | |
| 330 | 추가: "runtime_passed": null, | |
| 331 | 추가: "allowed": [ | |
| 332 | 추가: "rustfmt", | |
| 333 | 추가: "cargo metadata --locked --offline", | |
| 334 | 추가: "Python fixture generation and static consistency checks" | |
| 335 | 추가: ], | |
| 336 | 추가: "pending": "고정 통합 snapshot 검토 뒤 Rust 컴파일/발견/실행을 별도 배정받음." | |
| 337 | 추가: }, | |
| 338 | 추가: "limitations": [ | |
| 339 | 추가: "NoProgress와 빈 입력 drain 발생 자체는 공개 checkpoint만으로 증명하지 못함. 다중 출력과 정확한 최종 경계만 검증함.", | |
| 340 | 추가: "Invalid counter delta, u64 overflow, allocator failure, NeedDict/StreamError/MemError는 주입하지 않으며 미도달임.", | |
| 341 | 추가: "실제 시간 시험은 Start checkpoint 내 30ms 대기와 20ms 한도로 취소/콜백/시간 우선순위를 확인하는 소스임. 콜백 진입 전 미경과나 강제 중단 보장은 하지 않음.", | |
| 342 | 추가: "backend malformed stream 소비량 전체가 SharpZipLib와 같다고 주장하지 않음.", | |
| 343 | 추가: "Windows, 독립 실행, 제품 전체 수용, 사용자 archive, tar.gz/TAR 연결은 범위 밖임." | |
| 344 | 추가: ], | |
| 345 | 추가: "fixture_provenance": { | |
| 346 | 추가: "generator": "generate_fixtures.py", | |
| 347 | 추가: "manifest": "fixtures.json", | |
| 348 | 추가: "storage": "fixtures.hex", | |
| 349 | 추가: "data": "Python standard gzip/zlib and fixed empty/stored DEFLATE bytes, synthetic payloads only", | |
| 350 | 추가: "malformed": "정상 member의 헤더/trailer/후행/prefix 변조 및 기존 C# BudgetRegression의 000100feff4107 raw bytes를 재구성함. 신규 codec 구현 없음." | |
| 351 | 추가: }, | |
| 352 | 추가: "expected_test_count": 303, | |
| 353 | 추가: "test_names": [ | |
| 354 | 추가: "budgets::backend_error_output_charged_selected", | |
| 355 | 추가: "budgets::backend_error_output_charged_unselected", | |
| 356 | 추가: "budgets::crc_failure_retains_cost_and_retry_selected", | |
| 357 | 추가: "budgets::crc_failure_retains_cost_and_retry_unselected", | |
| 358 | 추가: "budgets::cumulative_metadata_selected", | |
| 359 | 추가: "budgets::cumulative_metadata_unselected", | |
| 360 | 추가: "budgets::cumulative_processed_selected", | |
| 361 | 추가: "budgets::cumulative_processed_unselected", | |
| 362 | 추가: "budgets::cumulative_selected_output", | |
| 363 | 추가: "budgets::exact_all_limits_selected", | |
| 364 | 추가: "budgets::exact_all_limits_unselected", | |
| 365 | 추가: "budgets::failed_header_retry_keeps_attempt_metadata", | |
| 366 | 추가: "budgets::input_0_selected", | |
| 367 | 추가: "budgets::input_0_unselected", | |
| 368 | 추가: "budgets::input_28_selected", | |
| 369 | 추가: "budgets::input_28_unselected", | |
| 370 | 추가: "budgets::input_29_selected", | |
| 371 | 추가: "budgets::input_29_unselected", | |
| 372 | 추가: "budgets::input_cap_is_per_request_selected", | |
| 373 | 추가: "budgets::input_cap_is_per_request_unselected", | |
| 374 | 추가: "budgets::limits_are_clamped_and_do_not_overflow", | |
| 375 | 추가: "budgets::metadata_0_selected", | |
| 376 | 추가: "budgets::metadata_0_unselected", | |
| 377 | 추가: "budgets::metadata_10_selected", | |
| 378 | 추가: "budgets::metadata_10_unselected", | |
| 379 | 추가: "budgets::metadata_9_selected", | |
| 380 | 추가: "budgets::metadata_9_unselected", | |
| 381 | 추가: "budgets::output_0_selected", | |
| 382 | 추가: "budgets::output_0_unselected", | |
| 383 | 추가: "budgets::output_8_selected", | |
| 384 | 추가: "budgets::output_8_unselected", | |
| 385 | 추가: "budgets::output_9_selected", | |
| 386 | 추가: "budgets::output_9_unselected", | |
| 387 | 추가: "budgets::output_failure_is_not_refunded_by_retry", | |
| 388 | 추가: "budgets::output_overrun_precedes_backend_selected", | |
| 389 | 추가: "budgets::output_overrun_precedes_backend_unselected", | |
| 390 | 추가: "budgets::processed_0_selected", | |
| 391 | 추가: "budgets::processed_0_unselected", | |
| 392 | 추가: "budgets::processed_37_selected", | |
| 393 | 추가: "budgets::processed_37_unselected", | |
| 394 | 추가: "budgets::processed_38_selected", | |
| 395 | 추가: "budgets::processed_38_unselected", | |
| 396 | 추가: "budgets::selected_empty_zero_output_selected", | |
| 397 | 추가: "budgets::selected_empty_zero_output_unselected", | |
| 398 | 추가: "budgets::selected_large_output_limit_precedes_later_chunks", | |
| 399 | 추가: "budgets::shared_budget_selected_then_unselected", | |
| 400 | 추가: "budgets::shared_budget_unselected_then_selected", | |
| 401 | 추가: "budgets::unselected_expansion_is_charged", | |
| 402 | 추가: "budgets::zero_byte_limits_are_valid_requests", | |
| 403 | 추가: "budgets::zero_duration_is_invalid", | |
| 404 | 추가: "checkpoints::after_inflate_callback_selected", | |
| 405 | 추가: "checkpoints::after_inflate_callback_unselected", | |
| 406 | 추가: "checkpoints::after_inflate_cancel_precedes_trailer_failure_selected", | |
| 407 | 추가: "checkpoints::after_inflate_cancel_precedes_trailer_failure_unselected", | |
| 408 | 추가: "checkpoints::after_inflate_cancel_selected", | |
| 409 | 추가: "checkpoints::after_inflate_cancel_unselected", | |
| 410 | 추가: "checkpoints::after_inflate_deadline_selected", | |
| 411 | 추가: "checkpoints::after_inflate_deadline_unselected", | |
| 412 | 추가: "checkpoints::after_output_callback_selected", | |
| 413 | 추가: "checkpoints::after_output_cancel_selected", | |
| 414 | 추가: "checkpoints::after_output_deadline_selected", | |
| 415 | 추가: "checkpoints::before_inflate_callback_selected", | |
| 416 | 추가: "checkpoints::before_inflate_callback_unselected", | |
| 417 | 추가: "checkpoints::before_inflate_cancel_selected", | |
| 418 | 추가: "checkpoints::before_inflate_cancel_unselected", | |
| 419 | 추가: "checkpoints::before_inflate_deadline_selected", | |
| 420 | 추가: "checkpoints::before_inflate_deadline_unselected", | |
| 421 | 추가: "checkpoints::before_return_callback_selected", | |
| 422 | 추가: "checkpoints::before_return_callback_unselected", | |
| 423 | 추가: "checkpoints::before_return_cancel_selected", | |
| 424 | 추가: "checkpoints::before_return_cancel_unselected", | |
| 425 | 추가: "checkpoints::before_return_deadline_selected", | |
| 426 | 추가: "checkpoints::before_return_deadline_unselected", | |
| 427 | 추가: "checkpoints::callback_identity_precedes_elapsed_deadline", | |
| 428 | 추가: "checkpoints::cancellation_precedes_existing_processed_overrun", | |
| 429 | 추가: "checkpoints::cancellation_precedes_input_cap", | |
| 430 | 추가: "checkpoints::cancelled_callback_precedes_elapsed_deadline", | |
| 431 | 추가: "checkpoints::completed_usage_snapshot_is_not_mutated_by_retry", | |
| 432 | 추가: "checkpoints::elapsed_deadline_after_callback_and_retry", | |
| 433 | 추가: "checkpoints::empty_selected_never_calls_after_output", | |
| 434 | 추가: "checkpoints::header_callback_selected", | |
| 435 | 추가: "checkpoints::header_callback_unselected", | |
| 436 | 추가: "checkpoints::header_cancel_selected", | |
| 437 | 추가: "checkpoints::header_cancel_unselected", | |
| 438 | 추가: "checkpoints::header_deadline_selected", | |
| 439 | 추가: "checkpoints::header_deadline_unselected", | |
| 440 | 추가: "checkpoints::output_chunks_are_bounded_and_complete", | |
| 441 | 추가: "checkpoints::output_failure_stops_later_callbacks", | |
| 442 | 추가: "checkpoints::start_callback_selected", | |
| 443 | 추가: "checkpoints::start_callback_unselected", | |
| 444 | 추가: "checkpoints::start_cancel_selected", | |
| 445 | 추가: "checkpoints::start_cancel_unselected", | |
| 446 | 추가: "checkpoints::start_deadline_selected", | |
| 447 | 추가: "checkpoints::start_deadline_unselected", | |
| 448 | 추가: "checkpoints::successful_checkpoint_trace_selected", | |
| 449 | 추가: "checkpoints::successful_checkpoint_trace_unselected", | |
| 450 | 추가: "checkpoints::trailer_callback_selected", | |
| 451 | 추가: "checkpoints::trailer_callback_unselected", | |
| 452 | 추가: "checkpoints::trailer_cancel_selected", | |
| 453 | 추가: "checkpoints::trailer_cancel_unselected", | |
| 454 | 추가: "checkpoints::trailer_deadline_selected", | |
| 455 | 추가: "checkpoints::trailer_deadline_unselected", | |
| 456 | 추가: "checkpoints::unselected_never_exposes_after_output", | |
| 457 | 추가: "format::byte_a_selected", | |
| 458 | 추가: "format::byte_a_unselected", | |
| 459 | 추가: "format::crc_before_size_and_trailing_selected", | |
| 460 | 추가: "format::crc_before_size_and_trailing_unselected", | |
| 461 | 추가: "format::empty_fixed_selected", | |
| 462 | 추가: "format::empty_fixed_unselected", | |
| 463 | 추가: "format::empty_options_selected", | |
| 464 | 추가: "format::empty_options_unselected", | |
| 465 | 추가: "format::empty_stored_selected", | |
| 466 | 추가: "format::empty_stored_unselected", | |
| 467 | 추가: "format::fhcrc_corrupt_16_selected", | |
| 468 | 추가: "format::fhcrc_corrupt_16_unselected", | |
| 469 | 추가: "format::fhcrc_corrupt_33_selected", | |
| 470 | 추가: "format::fhcrc_corrupt_33_unselected", | |
| 471 | 추가: "format::fhcrc_corrupt_34_selected", | |
| 472 | 추가: "format::fhcrc_corrupt_34_unselected", | |
| 473 | 추가: "format::flags_00_selected", | |
| 474 | 추가: "format::flags_00_unselected", | |
| 475 | 추가: "format::flags_01_selected", | |
| 476 | 추가: "format::flags_01_unselected", | |
| 477 | 추가: "format::flags_02_selected", | |
| 478 | 추가: "format::flags_02_unselected", | |
| 479 | 추가: "format::flags_03_selected", | |
| 480 | 추가: "format::flags_03_unselected", | |
| 481 | 추가: "format::flags_04_selected", | |
| 482 | 추가: "format::flags_04_unselected", | |
| 483 | 추가: "format::flags_05_selected", | |
| 484 | 추가: "format::flags_05_unselected", | |
| 485 | 추가: "format::flags_06_selected", | |
| 486 | 추가: "format::flags_06_unselected", | |
| 487 | 추가: "format::flags_07_selected", | |
| 488 | 추가: "format::flags_07_unselected", | |
| 489 | 추가: "format::flags_08_selected", | |
| 490 | 추가: "format::flags_08_unselected", | |
| 491 | 추가: "format::flags_09_selected", | |
| 492 | 추가: "format::flags_09_unselected", | |
| 493 | 추가: "format::flags_10_selected", | |
| 494 | 추가: "format::flags_10_unselected", | |
| 495 | 추가: "format::flags_11_selected", | |
| 496 | 추가: "format::flags_11_unselected", | |
| 497 | 추가: "format::flags_12_selected", | |
| 498 | 추가: "format::flags_12_unselected", | |
| 499 | 추가: "format::flags_13_selected", | |
| 500 | 추가: "format::flags_13_unselected", | |
| 501 | 추가: "format::flags_14_selected", | |
| 502 | 추가: "format::flags_14_unselected", | |
| 503 | 추가: "format::flags_15_selected", | |
| 504 | 추가: "format::flags_15_unselected", | |
| 505 | 추가: "format::flags_16_selected", | |
| 506 | 추가: "format::flags_16_unselected", | |
| 507 | 추가: "format::flags_17_selected", | |
| 508 | 추가: "format::flags_17_unselected", | |
| 509 | 추가: "format::flags_18_selected", | |
| 510 | 추가: "format::flags_18_unselected", | |
| 511 | 추가: "format::flags_19_selected", | |
| 512 | 추가: "format::flags_19_unselected", | |
| 513 | 추가: "format::flags_20_selected", | |
| 514 | 추가: "format::flags_20_unselected", | |
| 515 | 추가: "format::flags_21_selected", | |
| 516 | 추가: "format::flags_21_unselected", | |
| 517 | 추가: "format::flags_22_selected", | |
| 518 | 추가: "format::flags_22_unselected", | |
| 519 | 추가: "format::flags_23_selected", | |
| 520 | 추가: "format::flags_23_unselected", | |
| 521 | 추가: "format::flags_24_selected", | |
| 522 | 추가: "format::flags_24_unselected", | |
| 523 | 추가: "format::flags_25_selected", | |
| 524 | 추가: "format::flags_25_unselected", | |
| 525 | 추가: "format::flags_26_selected", | |
| 526 | 추가: "format::flags_26_unselected", | |
| 527 | 추가: "format::flags_27_selected", | |
| 528 | 추가: "format::flags_27_unselected", | |
| 529 | 추가: "format::flags_28_selected", | |
| 530 | 추가: "format::flags_28_unselected", | |
| 531 | 추가: "format::flags_29_selected", | |
| 532 | 추가: "format::flags_29_unselected", | |
| 533 | 추가: "format::flags_30_selected", | |
| 534 | 추가: "format::flags_30_unselected", | |
| 535 | 추가: "format::flags_31_selected", | |
| 536 | 추가: "format::flags_31_unselected", | |
| 537 | 추가: "format::header_truncation_charges_attempt_before_eof", | |
| 538 | 추가: "format::input_without_deflate_selected", | |
| 539 | 추가: "format::input_without_deflate_unselected", | |
| 540 | 추가: "format::invalid_crc_0_selected", | |
| 541 | 추가: "format::invalid_crc_0_unselected", | |
| 542 | 추가: "format::invalid_crc_1_selected", | |
| 543 | 추가: "format::invalid_crc_1_unselected", | |
| 544 | 추가: "format::invalid_crc_2_selected", | |
| 545 | 추가: "format::invalid_crc_2_unselected", | |
| 546 | 추가: "format::invalid_crc_3_selected", | |
| 547 | 추가: "format::invalid_crc_3_unselected", | |
| 548 | 추가: "format::invalid_header_0_selected", | |
| 549 | 추가: "format::invalid_header_0_unselected", | |
| 550 | 추가: "format::invalid_header_1_selected", | |
| 551 | 추가: "format::invalid_header_1_unselected", | |
| 552 | 추가: "format::invalid_header_2_selected", | |
| 553 | 추가: "format::invalid_header_2_unselected", | |
| 554 | 추가: "format::invalid_size_0_selected", | |
| 555 | 추가: "format::invalid_size_0_unselected", | |
| 556 | 추가: "format::invalid_size_1_selected", | |
| 557 | 추가: "format::invalid_size_1_unselected", | |
| 558 | 추가: "format::invalid_size_2_selected", | |
| 559 | 추가: "format::invalid_size_2_unselected", | |
| 560 | 추가: "format::invalid_size_3_selected", | |
| 561 | 추가: "format::invalid_size_3_unselected", | |
| 562 | 추가: "format::large_output_selected", | |
| 563 | 추가: "format::large_output_unselected", | |
| 564 | 추가: "format::multiple_input_selected", | |
| 565 | 추가: "format::multiple_input_unselected", | |
| 566 | 추가: "format::opaque_name_selected", | |
| 567 | 추가: "format::opaque_name_unselected", | |
| 568 | 추가: "format::read_ahead_is_not_recharged", | |
| 569 | 추가: "format::reserved_deflate_block_selected", | |
| 570 | 추가: "format::reserved_deflate_block_unselected", | |
| 571 | 추가: "format::reserved_flag_128_selected", | |
| 572 | 추가: "format::reserved_flag_128_unselected", | |
| 573 | 추가: "format::reserved_flag_32_selected", | |
| 574 | 추가: "format::reserved_flag_32_unselected", | |
| 575 | 추가: "format::reserved_flag_64_selected", | |
| 576 | 추가: "format::reserved_flag_64_unselected", | |
| 577 | 추가: "format::size_before_trailing_selected", | |
| 578 | 추가: "format::size_before_trailing_unselected", | |
| 579 | 추가: "format::trailing_empty_member_selected", | |
| 580 | 추가: "format::trailing_empty_member_unselected", | |
| 581 | 추가: "format::trailing_ff_selected", | |
| 582 | 추가: "format::trailing_ff_unselected", | |
| 583 | 추가: "format::trailing_magic_selected", | |
| 584 | 추가: "format::trailing_magic_unselected", | |
| 585 | 추가: "format::trailing_member_selected", | |
| 586 | 추가: "format::trailing_member_unselected", | |
| 587 | 추가: "format::trailing_padding_selected", | |
| 588 | 추가: "format::trailing_padding_unselected", | |
| 589 | 추가: "format::trailing_zero_selected", | |
| 590 | 추가: "format::trailing_zero_unselected", | |
| 591 | 추가: "format::truncate_flags_00_selected", | |
| 592 | 추가: "format::truncate_flags_00_unselected", | |
| 593 | 추가: "format::truncate_flags_01_selected", | |
| 594 | 추가: "format::truncate_flags_01_unselected", | |
| 595 | 추가: "format::truncate_flags_02_selected", | |
| 596 | 추가: "format::truncate_flags_02_unselected", | |
| 597 | 추가: "format::truncate_flags_03_selected", | |
| 598 | 추가: "format::truncate_flags_03_unselected", | |
| 599 | 추가: "format::truncate_flags_04_selected", | |
| 600 | 추가: "format::truncate_flags_04_unselected", | |
| 601 | 추가: "format::truncate_flags_05_selected", | |
| 602 | 추가: "format::truncate_flags_05_unselected", | |
| 603 | 추가: "format::truncate_flags_06_selected", | |
| 604 | 추가: "format::truncate_flags_06_unselected", | |
| 605 | 추가: "format::truncate_flags_07_selected", | |
| 606 | 추가: "format::truncate_flags_07_unselected", | |
| 607 | 추가: "format::truncate_flags_08_selected", | |
| 608 | 추가: "format::truncate_flags_08_unselected", | |
| 609 | 추가: "format::truncate_flags_09_selected", | |
| 610 | 추가: "format::truncate_flags_09_unselected", | |
| 611 | 추가: "format::truncate_flags_10_selected", | |
| 612 | 추가: "format::truncate_flags_10_unselected", | |
| 613 | 추가: "format::truncate_flags_11_selected", | |
| 614 | 추가: "format::truncate_flags_11_unselected", | |
| 615 | 추가: "format::truncate_flags_12_selected", | |
| 616 | 추가: "format::truncate_flags_12_unselected", | |
| 617 | 추가: "format::truncate_flags_13_selected", | |
| 618 | 추가: "format::truncate_flags_13_unselected", | |
| 619 | 추가: "format::truncate_flags_14_selected", | |
| 620 | 추가: "format::truncate_flags_14_unselected", | |
| 621 | 추가: "format::truncate_flags_15_selected", | |
| 622 | 추가: "format::truncate_flags_15_unselected", | |
| 623 | 추가: "format::truncate_flags_16_selected", | |
| 624 | 추가: "format::truncate_flags_16_unselected", | |
| 625 | 추가: "format::truncate_flags_17_selected", | |
| 626 | 추가: "format::truncate_flags_17_unselected", | |
| 627 | 추가: "format::truncate_flags_18_selected", | |
| 628 | 추가: "format::truncate_flags_18_unselected", | |
| 629 | 추가: "format::truncate_flags_19_selected", | |
| 630 | 추가: "format::truncate_flags_19_unselected", | |
| 631 | 추가: "format::truncate_flags_20_selected", | |
| 632 | 추가: "format::truncate_flags_20_unselected", | |
| 633 | 추가: "format::truncate_flags_21_selected", | |
| 634 | 추가: "format::truncate_flags_21_unselected", | |
| 635 | 추가: "format::truncate_flags_22_selected", | |
| 636 | 추가: "format::truncate_flags_22_unselected", | |
| 637 | 추가: "format::truncate_flags_23_selected", | |
| 638 | 추가: "format::truncate_flags_23_unselected", | |
| 639 | 추가: "format::truncate_flags_24_selected", | |
| 640 | 추가: "format::truncate_flags_24_unselected", | |
| 641 | 추가: "format::truncate_flags_25_selected", | |
| 642 | 추가: "format::truncate_flags_25_unselected", | |
| 643 | 추가: "format::truncate_flags_26_selected", | |
| 644 | 추가: "format::truncate_flags_26_unselected", | |
| 645 | 추가: "format::truncate_flags_27_selected", | |
| 646 | 추가: "format::truncate_flags_27_unselected", | |
| 647 | 추가: "format::truncate_flags_28_selected", | |
| 648 | 추가: "format::truncate_flags_28_unselected", | |
| 649 | 추가: "format::truncate_flags_29_selected", | |
| 650 | 추가: "format::truncate_flags_29_unselected", | |
| 651 | 추가: "format::truncate_flags_30_selected", | |
| 652 | 추가: "format::truncate_flags_30_unselected", | |
| 653 | 추가: "format::truncate_flags_31_selected", | |
| 654 | 추가: "format::truncate_flags_31_unselected", | |
| 655 | 추가: "format::zeros_three_selected", | |
| 656 | 추가: "format::zeros_three_unselected" | |
| 657 | 추가: ], | |
| 658 | 추가: "truncation_prefix_assertions_planned": 2656 | |
| 659 | 추가: } |
Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기| @@ -0,0 +1,367 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "generator": "Python standard gzip/zlib; synthetic known payloads only", | |
| 3 | 추가: "python": "3.14.4", | |
| 4 | 추가: "zlib_runtime": "1.3.1", | |
| 5 | 추가: "fixtures": { | |
| 6 | 추가: "flags_00": { | |
| 7 | 추가: "archive_bytes": 29, | |
| 8 | 추가: "header_bytes": 10, | |
| 9 | 추가: "deflate_bytes": 11, | |
| 10 | 추가: "payload_bytes": 9, | |
| 11 | 추가: "crc32": 3421780262, | |
| 12 | 추가: "archive_sha256": "d64e159cec6070c5cc22ddcd33573fec1069cd355c3f8ad3e5f9abeee1996acf", | |
| 13 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 14 | 추가: }, | |
| 15 | 추가: "flags_01": { | |
| 16 | 추가: "archive_bytes": 29, | |
| 17 | 추가: "header_bytes": 10, | |
| 18 | 추가: "deflate_bytes": 11, | |
| 19 | 추가: "payload_bytes": 9, | |
| 20 | 추가: "crc32": 3421780262, | |
| 21 | 추가: "archive_sha256": "69b442148ab8f06055ef6cbaf575561d34c6d99e2bd3e8079daa33fcaab17a07", | |
| 22 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 23 | 추가: }, | |
| 24 | 추가: "flags_02": { | |
| 25 | 추가: "archive_bytes": 31, | |
| 26 | 추가: "header_bytes": 12, | |
| 27 | 추가: "deflate_bytes": 11, | |
| 28 | 추가: "payload_bytes": 9, | |
| 29 | 추가: "crc32": 3421780262, | |
| 30 | 추가: "archive_sha256": "fed56bb6ca2d2af5e83416a941e35ae3bc7e16f0bb692db459f00a36ce29ab86", | |
| 31 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 32 | 추가: }, | |
| 33 | 추가: "flags_03": { | |
| 34 | 추가: "archive_bytes": 31, | |
| 35 | 추가: "header_bytes": 12, | |
| 36 | 추가: "deflate_bytes": 11, | |
| 37 | 추가: "payload_bytes": 9, | |
| 38 | 추가: "crc32": 3421780262, | |
| 39 | 추가: "archive_sha256": "a40b33a9d643da35414f9922b0b10224862087ebe2aad94d16c1dd94b79cb594", | |
| 40 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 41 | 추가: }, | |
| 42 | 추가: "flags_04": { | |
| 43 | 추가: "archive_bytes": 34, | |
| 44 | 추가: "header_bytes": 15, | |
| 45 | 추가: "deflate_bytes": 11, | |
| 46 | 추가: "payload_bytes": 9, | |
| 47 | 추가: "crc32": 3421780262, | |
| 48 | 추가: "archive_sha256": "70804a8b52ed989ab0929f18b3c54b79b6b322c68e1ea77ada7b85f498702cb4", | |
| 49 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 50 | 추가: }, | |
| 51 | 추가: "flags_05": { | |
| 52 | 추가: "archive_bytes": 34, | |
| 53 | 추가: "header_bytes": 15, | |
| 54 | 추가: "deflate_bytes": 11, | |
| 55 | 추가: "payload_bytes": 9, | |
| 56 | 추가: "crc32": 3421780262, | |
| 57 | 추가: "archive_sha256": "52ba2a52da2b9846746228efc769e9436bf93433532bbac2b163d078cbe4dea1", | |
| 58 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 59 | 추가: }, | |
| 60 | 추가: "flags_06": { | |
| 61 | 추가: "archive_bytes": 36, | |
| 62 | 추가: "header_bytes": 17, | |
| 63 | 추가: "deflate_bytes": 11, | |
| 64 | 추가: "payload_bytes": 9, | |
| 65 | 추가: "crc32": 3421780262, | |
| 66 | 추가: "archive_sha256": "3757b1f30326b87e7027cedb2ab106dcf615f38ee4b25ae8b427822dc8cfcf94", | |
| 67 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 68 | 추가: }, | |
| 69 | 추가: "flags_07": { | |
| 70 | 추가: "archive_bytes": 36, | |
| 71 | 추가: "header_bytes": 17, | |
| 72 | 추가: "deflate_bytes": 11, | |
| 73 | 추가: "payload_bytes": 9, | |
| 74 | 추가: "crc32": 3421780262, | |
| 75 | 추가: "archive_sha256": "c3cfefe496a6e4e05283bd9c2a4365d58ded60d8155cf02bea8e36a5804974e7", | |
| 76 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 77 | 추가: }, | |
| 78 | 추가: "flags_08": { | |
| 79 | 추가: "archive_bytes": 42, | |
| 80 | 추가: "header_bytes": 23, | |
| 81 | 추가: "deflate_bytes": 11, | |
| 82 | 추가: "payload_bytes": 9, | |
| 83 | 추가: "crc32": 3421780262, | |
| 84 | 추가: "archive_sha256": "c5882308d7440c64c7666c8b9bf07798531424903df8f34a6af2cc5f19618b43", | |
| 85 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 86 | 추가: }, | |
| 87 | 추가: "flags_09": { | |
| 88 | 추가: "archive_bytes": 42, | |
| 89 | 추가: "header_bytes": 23, | |
| 90 | 추가: "deflate_bytes": 11, | |
| 91 | 추가: "payload_bytes": 9, | |
| 92 | 추가: "crc32": 3421780262, | |
| 93 | 추가: "archive_sha256": "ebe59e710209330b1e3aedbe8ff6dc178bc936282d530a73bc40689480c5b4e0", | |
| 94 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 95 | 추가: }, | |
| 96 | 추가: "flags_10": { | |
| 97 | 추가: "archive_bytes": 44, | |
| 98 | 추가: "header_bytes": 25, | |
| 99 | 추가: "deflate_bytes": 11, | |
| 100 | 추가: "payload_bytes": 9, | |
| 101 | 추가: "crc32": 3421780262, | |
| 102 | 추가: "archive_sha256": "ff24a28d7f5f8f39bb57102bc419d984d1f40a8ba02d36e622b1a51cef1931e2", | |
| 103 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 104 | 추가: }, | |
| 105 | 추가: "flags_11": { | |
| 106 | 추가: "archive_bytes": 44, | |
| 107 | 추가: "header_bytes": 25, | |
| 108 | 추가: "deflate_bytes": 11, | |
| 109 | 추가: "payload_bytes": 9, | |
| 110 | 추가: "crc32": 3421780262, | |
| 111 | 추가: "archive_sha256": "f32a0950c2d345c9bb07e1ae1d1561ee4eb946b3893949462387d02dfd4a3f05", | |
| 112 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 113 | 추가: }, | |
| 114 | 추가: "flags_12": { | |
| 115 | 추가: "archive_bytes": 47, | |
| 116 | 추가: "header_bytes": 28, | |
| 117 | 추가: "deflate_bytes": 11, | |
| 118 | 추가: "payload_bytes": 9, | |
| 119 | 추가: "crc32": 3421780262, | |
| 120 | 추가: "archive_sha256": "a09ea01a450069bcd06cb37d581a8be7a1e6124a059d4d1c453850a0f939c774", | |
| 121 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 122 | 추가: }, | |
| 123 | 추가: "flags_13": { | |
| 124 | 추가: "archive_bytes": 47, | |
| 125 | 추가: "header_bytes": 28, | |
| 126 | 추가: "deflate_bytes": 11, | |
| 127 | 추가: "payload_bytes": 9, | |
| 128 | 추가: "crc32": 3421780262, | |
| 129 | 추가: "archive_sha256": "16ffd13035de98964031a6bf1411b69307e046547e59f658473ee864953b3a37", | |
| 130 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 131 | 추가: }, | |
| 132 | 추가: "flags_14": { | |
| 133 | 추가: "archive_bytes": 49, | |
| 134 | 추가: "header_bytes": 30, | |
| 135 | 추가: "deflate_bytes": 11, | |
| 136 | 추가: "payload_bytes": 9, | |
| 137 | 추가: "crc32": 3421780262, | |
| 138 | 추가: "archive_sha256": "5a2b6dec759e106801df517b753d0185f81f6df4031a9d155d268b46388be91a", | |
| 139 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 140 | 추가: }, | |
| 141 | 추가: "flags_15": { | |
| 142 | 추가: "archive_bytes": 49, | |
| 143 | 추가: "header_bytes": 30, | |
| 144 | 추가: "deflate_bytes": 11, | |
| 145 | 추가: "payload_bytes": 9, | |
| 146 | 추가: "crc32": 3421780262, | |
| 147 | 추가: "archive_sha256": "b336efae86f2d36b9162c1bf3cd24b67226821191a7d1a9c3357d73cf306c1c0", | |
| 148 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 149 | 추가: }, | |
| 150 | 추가: "flags_16": { | |
| 151 | 추가: "archive_bytes": 34, | |
| 152 | 추가: "header_bytes": 15, | |
| 153 | 추가: "deflate_bytes": 11, | |
| 154 | 추가: "payload_bytes": 9, | |
| 155 | 추가: "crc32": 3421780262, | |
| 156 | 추가: "archive_sha256": "f7daf63398c8d9f24f9ce629b707c3195a01913f9e156d87ebae747af3a34162", | |
| 157 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 158 | 추가: }, | |
| 159 | 추가: "flags_17": { | |
| 160 | 추가: "archive_bytes": 34, | |
| 161 | 추가: "header_bytes": 15, | |
| 162 | 추가: "deflate_bytes": 11, | |
| 163 | 추가: "payload_bytes": 9, | |
| 164 | 추가: "crc32": 3421780262, | |
| 165 | 추가: "archive_sha256": "b110df8cfa960bb37c63f98e124921bd58ecf7d7dc96843836943808637a13e4", | |
| 166 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 167 | 추가: }, | |
| 168 | 추가: "flags_18": { | |
| 169 | 추가: "archive_bytes": 36, | |
| 170 | 추가: "header_bytes": 17, | |
| 171 | 추가: "deflate_bytes": 11, | |
| 172 | 추가: "payload_bytes": 9, | |
| 173 | 추가: "crc32": 3421780262, | |
| 174 | 추가: "archive_sha256": "af9ca97720ced7ec71cc59ee213f27d68802a658d200ff086dd6479742f3cdbf", | |
| 175 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 176 | 추가: }, | |
| 177 | 추가: "flags_19": { | |
| 178 | 추가: "archive_bytes": 36, | |
| 179 | 추가: "header_bytes": 17, | |
| 180 | 추가: "deflate_bytes": 11, | |
| 181 | 추가: "payload_bytes": 9, | |
| 182 | 추가: "crc32": 3421780262, | |
| 183 | 추가: "archive_sha256": "ffa6011d30055f30157199ce58f6aadb1f04c6973004468c9fc5b8d48458042f", | |
| 184 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 185 | 추가: }, | |
| 186 | 추가: "flags_20": { | |
| 187 | 추가: "archive_bytes": 39, | |
| 188 | 추가: "header_bytes": 20, | |
| 189 | 추가: "deflate_bytes": 11, | |
| 190 | 추가: "payload_bytes": 9, | |
| 191 | 추가: "crc32": 3421780262, | |
| 192 | 추가: "archive_sha256": "2dd86fa177fe916a40edecafd49ceec4c4a8b9d67abc76eb62a9f7b0a993d31c", | |
| 193 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 194 | 추가: }, | |
| 195 | 추가: "flags_21": { | |
| 196 | 추가: "archive_bytes": 39, | |
| 197 | 추가: "header_bytes": 20, | |
| 198 | 추가: "deflate_bytes": 11, | |
| 199 | 추가: "payload_bytes": 9, | |
| 200 | 추가: "crc32": 3421780262, | |
| 201 | 추가: "archive_sha256": "e95e12b1f6ec09f6a2ebe3be3cdc7a1901ef5a8f2120e3f0ca01a8bd8b6f5c3b", | |
| 202 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 203 | 추가: }, | |
| 204 | 추가: "flags_22": { | |
| 205 | 추가: "archive_bytes": 41, | |
| 206 | 추가: "header_bytes": 22, | |
| 207 | 추가: "deflate_bytes": 11, | |
| 208 | 추가: "payload_bytes": 9, | |
| 209 | 추가: "crc32": 3421780262, | |
| 210 | 추가: "archive_sha256": "538e90dc3571a09e6c722489cd2d7de3763693e3c8435313f31534722caecf9e", | |
| 211 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 212 | 추가: }, | |
| 213 | 추가: "flags_23": { | |
| 214 | 추가: "archive_bytes": 41, | |
| 215 | 추가: "header_bytes": 22, | |
| 216 | 추가: "deflate_bytes": 11, | |
| 217 | 추가: "payload_bytes": 9, | |
| 218 | 추가: "crc32": 3421780262, | |
| 219 | 추가: "archive_sha256": "5983c3dc7524128ab2b48d5c6ec4908f182413417f0ac19c34c4da7663479173", | |
| 220 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 221 | 추가: }, | |
| 222 | 추가: "flags_24": { | |
| 223 | 추가: "archive_bytes": 47, | |
| 224 | 추가: "header_bytes": 28, | |
| 225 | 추가: "deflate_bytes": 11, | |
| 226 | 추가: "payload_bytes": 9, | |
| 227 | 추가: "crc32": 3421780262, | |
| 228 | 추가: "archive_sha256": "baa897a67ec57ce6520c9605d674d797f2ab7636ddf7d69c7752933e16b5c682", | |
| 229 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 230 | 추가: }, | |
| 231 | 추가: "flags_25": { | |
| 232 | 추가: "archive_bytes": 47, | |
| 233 | 추가: "header_bytes": 28, | |
| 234 | 추가: "deflate_bytes": 11, | |
| 235 | 추가: "payload_bytes": 9, | |
| 236 | 추가: "crc32": 3421780262, | |
| 237 | 추가: "archive_sha256": "0313e3941cc9415845864744bda85762f2f3ed9c61f655f819672d2c0208761f", | |
| 238 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 239 | 추가: }, | |
| 240 | 추가: "flags_26": { | |
| 241 | 추가: "archive_bytes": 49, | |
| 242 | 추가: "header_bytes": 30, | |
| 243 | 추가: "deflate_bytes": 11, | |
| 244 | 추가: "payload_bytes": 9, | |
| 245 | 추가: "crc32": 3421780262, | |
| 246 | 추가: "archive_sha256": "dc96d028a2331246758dd12701308465e5dc056cc29a94ba9a28904b3a42c595", | |
| 247 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 248 | 추가: }, | |
| 249 | 추가: "flags_27": { | |
| 250 | 추가: "archive_bytes": 49, | |
| 251 | 추가: "header_bytes": 30, | |
| 252 | 추가: "deflate_bytes": 11, | |
| 253 | 추가: "payload_bytes": 9, | |
| 254 | 추가: "crc32": 3421780262, | |
| 255 | 추가: "archive_sha256": "53355f02b9734a616ade7de7c382fc34fdc632f67b09b93fde22427c74ab3672", | |
| 256 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 257 | 추가: }, | |
| 258 | 추가: "flags_28": { | |
| 259 | 추가: "archive_bytes": 52, | |
| 260 | 추가: "header_bytes": 33, | |
| 261 | 추가: "deflate_bytes": 11, | |
| 262 | 추가: "payload_bytes": 9, | |
| 263 | 추가: "crc32": 3421780262, | |
| 264 | 추가: "archive_sha256": "9817825b35d13d908661cc5e1c83a57738698d5796d675dea9d621908e78362e", | |
| 265 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 266 | 추가: }, | |
| 267 | 추가: "flags_29": { | |
| 268 | 추가: "archive_bytes": 52, | |
| 269 | 추가: "header_bytes": 33, | |
| 270 | 추가: "deflate_bytes": 11, | |
| 271 | 추가: "payload_bytes": 9, | |
| 272 | 추가: "crc32": 3421780262, | |
| 273 | 추가: "archive_sha256": "8c2e42c9c1f39071838c78f9149394117b7d23d690f97f3e05799ca28170d303", | |
| 274 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 275 | 추가: }, | |
| 276 | 추가: "flags_30": { | |
| 277 | 추가: "archive_bytes": 54, | |
| 278 | 추가: "header_bytes": 35, | |
| 279 | 추가: "deflate_bytes": 11, | |
| 280 | 추가: "payload_bytes": 9, | |
| 281 | 추가: "crc32": 3421780262, | |
| 282 | 추가: "archive_sha256": "c7b4f9329989bcd313cf3e9ec165bbf08fac587d447646926306408ddbf77808", | |
| 283 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 284 | 추가: }, | |
| 285 | 추가: "flags_31": { | |
| 286 | 추가: "archive_bytes": 54, | |
| 287 | 추가: "header_bytes": 35, | |
| 288 | 추가: "deflate_bytes": 11, | |
| 289 | 추가: "payload_bytes": 9, | |
| 290 | 추가: "crc32": 3421780262, | |
| 291 | 추가: "archive_sha256": "a5e64bc3bbba207bf3f6832d31e02ab39138023b4f39b1d90009a2e41fe5e3a7", | |
| 292 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 293 | 추가: }, | |
| 294 | 추가: "empty_fixed": { | |
| 295 | 추가: "archive_bytes": 20, | |
| 296 | 추가: "header_bytes": 10, | |
| 297 | 추가: "deflate_bytes": 2, | |
| 298 | 추가: "payload_bytes": 0, | |
| 299 | 추가: "crc32": 0, | |
| 300 | 추가: "archive_sha256": "ac73670af3abed54ac6fb4695131f4099be9fbe39d6076c5d0264a6bbdae9d83", | |
| 301 | 추가: "payload_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | |
| 302 | 추가: }, | |
| 303 | 추가: "empty_stored": { | |
| 304 | 추가: "archive_bytes": 23, | |
| 305 | 추가: "header_bytes": 10, | |
| 306 | 추가: "deflate_bytes": 5, | |
| 307 | 추가: "payload_bytes": 0, | |
| 308 | 추가: "crc32": 0, | |
| 309 | 추가: "archive_sha256": "30e6fa98fb48c2b132824d1ac5e2243c0be9e9082ff32598d34d7687ca7f6c7f", | |
| 310 | 추가: "payload_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | |
| 311 | 추가: }, | |
| 312 | 추가: "zeros_three": { | |
| 313 | 추가: "archive_bytes": 23, | |
| 314 | 추가: "header_bytes": 10, | |
| 315 | 추가: "deflate_bytes": 5, | |
| 316 | 추가: "payload_bytes": 3, | |
| 317 | 추가: "crc32": 4282505490, | |
| 318 | 추가: "archive_sha256": "7119839aec9b7d60263ce9f79f2799e9eea172845e32ccdfc9f76daebac95e52", | |
| 319 | 추가: "payload_sha256": "709e80c88487a2411e1ee4dfb9f22a861492d20c4765150c0c794abd70f8147c" | |
| 320 | 추가: }, | |
| 321 | 추가: "byte_a": { | |
| 322 | 추가: "archive_bytes": 24, | |
| 323 | 추가: "header_bytes": 10, | |
| 324 | 추가: "deflate_bytes": 6, | |
| 325 | 추가: "payload_bytes": 1, | |
| 326 | 추가: "crc32": 3554254475, | |
| 327 | 추가: "archive_sha256": "78ac91c8234ec03d6abfa3eed234b6ca8fa23f5f849b73766805a8ce61a6b1f9", | |
| 328 | 추가: "payload_sha256": "559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd" | |
| 329 | 추가: }, | |
| 330 | 추가: "opaque_name": { | |
| 331 | 추가: "archive_bytes": 39, | |
| 332 | 추가: "header_bytes": 20, | |
| 333 | 추가: "deflate_bytes": 11, | |
| 334 | 추가: "payload_bytes": 9, | |
| 335 | 추가: "crc32": 3421780262, | |
| 336 | 추가: "archive_sha256": "3f0c6c144349efe0001ddefb171af38c867631c20c886b7db79904beab86e08b", | |
| 337 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 338 | 추가: }, | |
| 339 | 추가: "empty_options": { | |
| 340 | 추가: "archive_bytes": 35, | |
| 341 | 추가: "header_bytes": 16, | |
| 342 | 추가: "deflate_bytes": 11, | |
| 343 | 추가: "payload_bytes": 9, | |
| 344 | 추가: "crc32": 3421780262, | |
| 345 | 추가: "archive_sha256": "dfbad4658ab6293075a7fb69fff3e59bb95cf996ee8f3f949cac087f4adc63dc", | |
| 346 | 추가: "payload_sha256": "15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" | |
| 347 | 추가: }, | |
| 348 | 추가: "large_output": { | |
| 349 | 추가: "archive_bytes": 230, | |
| 350 | 추가: "header_bytes": 10, | |
| 351 | 추가: "deflate_bytes": 212, | |
| 352 | 추가: "payload_bytes": 200003, | |
| 353 | 추가: "crc32": 1109513937, | |
| 354 | 추가: "archive_sha256": "c43652f638f7831b3f26dcc6ab4a294ff1e7f19853a38f930a4218f6e3779be5", | |
| 355 | 추가: "payload_sha256": "96a665f6eb35f423647683267dbbc5530d2ea3e43d47c3db66e45c20d664253f" | |
| 356 | 추가: }, | |
| 357 | 추가: "multiple_input": { | |
| 358 | 추가: "archive_bytes": 65565, | |
| 359 | 추가: "header_bytes": 10, | |
| 360 | 추가: "deflate_bytes": 65547, | |
| 361 | 추가: "payload_bytes": 65537, | |
| 362 | 추가: "crc32": 2848747123, | |
| 363 | 추가: "archive_sha256": "5a0d8718fa92e13e84af6e12e2d886a4de59189dd1269c91bee5211cc4258862", | |
| 364 | 추가: "payload_sha256": "237356e18b503616912abb8ffaed3a72591e397d4ac294c4637917d48a3f529d" | |
| 365 | 추가: } | |
| 366 | 추가: } | |
| 367 | 추가: } |
Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기| @@ -0,0 +1,70 @@ | ||
| 1 | 추가: import gzip | |
| 2 | 추가: import hashlib | |
| 3 | 추가: import json | |
| 4 | 추가: import pathlib | |
| 5 | 추가: import platform | |
| 6 | 추가: import struct | |
| 7 | 추가: import zlib | |
| 8 | 추가: | |
| 9 | 추가: BASE = pathlib.Path(__file__).resolve().parent | |
| 10 | 추가: | |
| 11 | 추가: | |
| 12 | 추가: def member(payload, flags=0, raw=None, name=b"../../escape", comment=b"note", extra=b"\x00\xff\x07"): | |
| 13 | 추가: header = bytearray(b"\x1f\x8b\x08" + bytes([flags]) + b"\0\0\0\0\0\xff") | |
| 14 | 추가: if flags & 4: | |
| 15 | 추가: header += struct.pack("<H", len(extra)) + extra | |
| 16 | 추가: if flags & 8: | |
| 17 | 추가: header += name + b"\0" | |
| 18 | 추가: if flags & 16: | |
| 19 | 추가: header += comment + b"\0" | |
| 20 | 추가: if flags & 2: | |
| 21 | 추가: header += struct.pack("<H", zlib.crc32(header) & 0xffff) | |
| 22 | 추가: if raw is None: | |
| 23 | 추가: encoder = zlib.compressobj(6, zlib.DEFLATED, -15) | |
| 24 | 추가: raw = encoder.compress(payload) + encoder.flush() | |
| 25 | 추가: trailer = struct.pack("<II", zlib.crc32(payload), len(payload) & 0xffffffff) | |
| 26 | 추가: return bytes(header) + raw + trailer, len(header), len(raw) | |
| 27 | 추가: | |
| 28 | 추가: | |
| 29 | 추가: def produce(): | |
| 30 | 추가: records = {} | |
| 31 | 추가: lines = [] | |
| 32 | 추가: | |
| 33 | 추가: def add(key, payload, **kwargs): | |
| 34 | 추가: archive, header, raw = member(payload, **kwargs) | |
| 35 | 추가: assert gzip.decompress(archive) == payload | |
| 36 | 추가: lines.append(key + ":" + archive.hex()) | |
| 37 | 추가: records[key] = { | |
| 38 | 추가: "archive_bytes": len(archive), | |
| 39 | 추가: "header_bytes": header, | |
| 40 | 추가: "deflate_bytes": raw, | |
| 41 | 추가: "payload_bytes": len(payload), | |
| 42 | 추가: "crc32": zlib.crc32(payload), | |
| 43 | 추가: "archive_sha256": hashlib.sha256(archive).hexdigest(), | |
| 44 | 추가: "payload_sha256": hashlib.sha256(payload).hexdigest(), | |
| 45 | 추가: } | |
| 46 | 추가: | |
| 47 | 추가: for flags in range(32): | |
| 48 | 추가: add(f"flags_{flags:02}", b"123456789", flags=flags) | |
| 49 | 추가: add("empty_fixed", b"", raw=bytes.fromhex("0300")) | |
| 50 | 추가: add("empty_stored", b"", raw=bytes.fromhex("010000ffff")) | |
| 51 | 추가: add("zeros_three", b"\0\0\0") | |
| 52 | 추가: add("byte_a", b"A", raw=bytes.fromhex("010100feff41")) | |
| 53 | 추가: add("opaque_name", b"123456789", flags=26, name=b"\xff../x", comment=b"\xfe") | |
| 54 | 추가: add("empty_options", b"123456789", flags=30, name=b"", comment=b"", extra=b"") | |
| 55 | 추가: add("large_output", b"A" * 200003) | |
| 56 | 추가: encoder = zlib.compressobj(0, zlib.DEFLATED, -15) | |
| 57 | 추가: payload = bytes(i % 251 for i in range(65537)) | |
| 58 | 추가: add("multiple_input", payload, raw=encoder.compress(payload) + encoder.flush()) | |
| 59 | 추가: return "\n".join(lines) + "\n", { | |
| 60 | 추가: "generator": "Python standard gzip/zlib; synthetic known payloads only", | |
| 61 | 추가: "python": platform.python_version(), | |
| 62 | 추가: "zlib_runtime": zlib.ZLIB_RUNTIME_VERSION, | |
| 63 | 추가: "fixtures": records, | |
| 64 | 추가: } | |
| 65 | 추가: | |
| 66 | 추가: | |
| 67 | 추가: if __name__ == "__main__": | |
| 68 | 추가: data, manifest = produce() | |
| 69 | 추가: (BASE / "fixtures.hex").write_text(data) | |
| 70 | 추가: (BASE / "fixtures.json").write_text(json.dumps(manifest, indent=4) + "\n") |
| @@ -0,0 +1,6 @@ | ||
| 1 | 추가: #![forbid(unsafe_code)] | |
| 2 | 추가: | |
| 3 | 추가: mod budgets; | |
| 4 | 추가: mod checkpoints; | |
| 5 | 추가: mod format; | |
| 6 | 추가: mod support; |
| @@ -0,0 +1,147 @@ | ||
| 1 | 추가: import argparse | |
| 2 | 추가: import hashlib | |
| 3 | 추가: import json | |
| 4 | 추가: import pathlib | |
| 5 | 추가: import re | |
| 6 | 추가: import runpy | |
| 7 | 추가: import tomllib | |
| 8 | 추가: | |
| 9 | 추가: BASE = pathlib.Path(__file__).resolve().parent | |
| 10 | 추가: ROOT = BASE.parent.parent | |
| 11 | 추가: SOURCE = ROOT / "experiments/rust-memory-gzip-reader" | |
| 12 | 추가: SOURCE_HEAD = "e1ffd7bbffc358b6e53358682a93bf3ce075e892" | |
| 13 | 추가: SOURCE_MANIFEST = "13e41e7d8ce2442cd8d93b1229211a5257e0568acc3466d5f9ec37f03c72a736" | |
| 14 | 추가: TEST_FILES = { | |
| 15 | 추가: "Cargo.toml", "Cargo.lock", "main.rs", "support.rs", "format.rs", | |
| 16 | 추가: "budgets.rs", "checkpoints.rs", "generate_fixtures.py", | |
| 17 | 추가: "fixtures.hex", "fixtures.json", "contract.json", "static_check.py", | |
| 18 | 추가: } | |
| 19 | 추가: SOURCE_FILES = { | |
| 20 | 추가: "Cargo.toml", "Cargo.lock", "LICENSE", "THIRD-PARTY-NOTICES.txt", | |
| 21 | 추가: "contract.json", "dependencies.json", "src/lib.rs", "src/budget.rs", | |
| 22 | 추가: } | |
| 23 | 추가: | |
| 24 | 추가: | |
| 25 | 추가: def digest(path): | |
| 26 | 추가: return hashlib.sha256(path.read_bytes()).hexdigest() | |
| 27 | 추가: | |
| 28 | 추가: | |
| 29 | 추가: def verify_manifest(base, expected_digest, paths): | |
| 30 | 추가: manifest = base / "SHA256SUMS" | |
| 31 | 추가: assert re.fullmatch(r"[0-9a-f]{64}", expected_digest), "신뢰 hash 형식 오류" | |
| 32 | 추가: assert not manifest.is_symlink() | |
| 33 | 추가: assert digest(manifest) == expected_digest, str(manifest) | |
| 34 | 추가: records = {} | |
| 35 | 추가: for line in manifest.read_text().splitlines(): | |
| 36 | 추가: match = re.fullmatch(r"([0-9a-f]{64}) ([A-Za-z0-9_./-]+)", line) | |
| 37 | 추가: assert match, f"잘못된 manifest 행: {line!r}" | |
| 38 | 추가: expected, name = match.groups() | |
| 39 | 추가: relative = pathlib.PurePosixPath(name) | |
| 40 | 추가: assert not relative.is_absolute() and all(part not in {"", ".", ".."} for part in name.split("/")) | |
| 41 | 추가: assert name not in records and name in paths, name | |
| 42 | 추가: path = base / name | |
| 43 | 추가: assert not any(parent.is_symlink() for parent in [path, *path.parents]) | |
| 44 | 추가: assert path.resolve().is_relative_to(base.resolve()) and path.is_file(), name | |
| 45 | 추가: assert digest(path) == expected, name | |
| 46 | 추가: records[name] = expected | |
| 47 | 추가: assert set(records) == paths, "manifest 경로 누락" | |
| 48 | 추가: return records | |
| 49 | 추가: | |
| 50 | 추가: | |
| 51 | 추가: def verify_pin(record): | |
| 52 | 추가: path = ROOT / record["path"] | |
| 53 | 추가: content = path.read_bytes() | |
| 54 | 추가: assert hashlib.sha256(content).hexdigest() == record["sha256"], record["path"] | |
| 55 | 추가: blob = b"blob " + str(len(content)).encode() + b"\0" + content | |
| 56 | 추가: assert hashlib.sha1(blob).hexdigest() == record["git_blob"], record["path"] | |
| 57 | 추가: | |
| 58 | 추가: | |
| 59 | 추가: def main(): | |
| 60 | 추가: parser = argparse.ArgumentParser() | |
| 61 | 추가: parser.add_argument("--source-head", required=True) | |
| 62 | 추가: parser.add_argument("--test-manifest-sha256", required=True) | |
| 63 | 추가: args = parser.parse_args() | |
| 64 | 추가: assert args.source_head == SOURCE_HEAD | |
| 65 | 추가: test_records = verify_manifest(BASE, args.test_manifest_sha256, TEST_FILES) | |
| 66 | 추가: source_records = verify_manifest(SOURCE, SOURCE_MANIFEST, SOURCE_FILES) | |
| 67 | 추가: contract = json.loads((BASE / "contract.json").read_text()) | |
| 68 | 추가: assert contract["source_commit"] == SOURCE_HEAD | |
| 69 | 추가: pins = contract["source_pins"] + contract["baseline"]["pins"] | |
| 70 | 추가: assert len(pins) == len({row["path"] for row in pins}) == 16 | |
| 71 | 추가: assert {row["path"] for row in contract["source_pins"]} == { | |
| 72 | 추가: "experiments/rust-memory-gzip-reader/" + name for name in SOURCE_FILES | {"SHA256SUMS"} | |
| 73 | 추가: } | |
| 74 | 추가: for record in pins: | |
| 75 | 추가: verify_pin(record) | |
| 76 | 추가: | |
| 77 | 추가: names = [] | |
| 78 | 추가: counts = {} | |
| 79 | 추가: for path in sorted(BASE.glob("*.rs")): | |
| 80 | 추가: source = path.read_text() | |
| 81 | 추가: assert not re.search(r"#\[ignore\]|\bunsafe\s*\{|include!|#\[path|\bextern\s", source), path.name | |
| 82 | 추가: found = re.findall(r"#\[test\]\s*fn\s+(\w+)\s*\(", source) | |
| 83 | 추가: names.extend(f"{path.stem}::{name}" for name in found) | |
| 84 | 추가: if found: | |
| 85 | 추가: counts[path.stem] = len(found) | |
| 86 | 추가: assert len(names) == len(set(names)) == contract["expected_test_count"] | |
| 87 | 추가: assert sorted(names) == contract["test_names"] | |
| 88 | 추가: assert set(counts) == {"format", "budgets", "checkpoints"} | |
| 89 | 추가: for mapping in contract["applicability"]: | |
| 90 | 추가: assert mapping["status"] in {"maintained", "adapted", "not_applicable"} | |
| 91 | 추가: for prefix in mapping["rust_prefixes"]: | |
| 92 | 추가: assert any(name.startswith(prefix) for name in names), prefix | |
| 93 | 추가: for flag in range(32): | |
| 94 | 추가: for selected in ["selected", "unselected"]: | |
| 95 | 추가: assert f"format::flags_{flag:02}_{selected}" in names | |
| 96 | 추가: assert f"format::truncate_flags_{flag:02}_{selected}" in names | |
| 97 | 추가: | |
| 98 | 추가: cargo = tomllib.loads((BASE / "Cargo.toml").read_text()) | |
| 99 | 추가: assert cargo["dependencies"] == { | |
| 100 | 추가: "zipelo-memory-gzip-reader": {"path": "../../experiments/rust-memory-gzip-reader"} | |
| 101 | 추가: } | |
| 102 | 추가: assert cargo["test"] == [{"name": "memory_gzip_reader", "path": "main.rs"}] | |
| 103 | 추가: assert cargo["package"]["autotests"] is False | |
| 104 | 추가: assert "build" not in cargo["package"] and "build-dependencies" not in cargo | |
| 105 | 추가: assert "workspace" in cargo | |
| 106 | 추가: source_lock = tomllib.loads((SOURCE / "Cargo.lock").read_text()) | |
| 107 | 추가: test_lock = tomllib.loads((BASE / "Cargo.lock").read_text()) | |
| 108 | 추가: source_packages = {row["name"]: row for row in source_lock["package"]} | |
| 109 | 추가: test_packages = {row["name"]: row for row in test_lock["package"]} | |
| 110 | 추가: assert set(test_packages) == set(source_packages) | {"zipelo-memory-gzip-regressions"} | |
| 111 | 추가: assert all(test_packages[key] == row for key, row in source_packages.items()) | |
| 112 | 추가: assert test_packages["zipelo-memory-gzip-regressions"]["dependencies"] == ["zipelo-memory-gzip-reader"] | |
| 113 | 추가: | |
| 114 | 추가: generator = runpy.run_path(str(BASE / "generate_fixtures.py")) | |
| 115 | 추가: generated, fixture_info = generator["produce"]() | |
| 116 | 추가: assert generated == (BASE / "fixtures.hex").read_text() | |
| 117 | 추가: recorded_info = json.loads((BASE / "fixtures.json").read_text()) | |
| 118 | 추가: assert fixture_info["fixtures"] == recorded_info["fixtures"] | |
| 119 | 추가: assert len(recorded_info["fixtures"]) == 40 | |
| 120 | 추가: assert contract["truncation_prefix_assertions_planned"] == 2 * sum( | |
| 121 | 추가: row["archive_bytes"] for name, row in recorded_info["fixtures"].items() if name.startswith("flags_") | |
| 122 | 추가: ) | |
| 123 | 추가: for record in pins: | |
| 124 | 추가: verify_pin(record) | |
| 125 | 추가: verify_manifest(BASE, args.test_manifest_sha256, TEST_FILES) | |
| 126 | 추가: verify_manifest(SOURCE, SOURCE_MANIFEST, SOURCE_FILES) | |
| 127 | 추가: print(json.dumps({ | |
| 128 | 추가: "result": "static_checks_passed", | |
| 129 | 추가: "source_commit": SOURCE_HEAD, | |
| 130 | 추가: "source_manifest_sha256": SOURCE_MANIFEST, | |
| 131 | 추가: "test_manifest_sha256": args.test_manifest_sha256, | |
| 132 | 추가: "helper_sha256": test_records["static_check.py"], | |
| 133 | 추가: "declared_tests": len(names), | |
| 134 | 추가: "module_counts": counts, | |
| 135 | 추가: "source_manifest_entries": len(source_records), | |
| 136 | 추가: "test_manifest_entries": len(test_records), | |
| 137 | 추가: "csharp_files_checked": len(contract["baseline"]["pins"]), | |
| 138 | 추가: "python_fixtures_regenerated": len(recorded_info["fixtures"]), | |
| 139 | 추가: "rust_compiled": False, | |
| 140 | 추가: "runtime_discovered": None, | |
| 141 | 추가: "runtime_executed": 0, | |
| 142 | 추가: "runtime_passed": None, | |
| 143 | 추가: }, ensure_ascii=False, indent=4)) | |
| 144 | 추가: | |
| 145 | 추가: | |
| 146 | 추가: if __name__ == "__main__": | |
| 147 | 추가: main() |
| @@ -0,0 +1,85 @@ | ||
| 1 | 추가: use std::convert::Infallible; | |
| 2 | 추가: use zipelo_memory_gzip_reader::{Budget, Completed, Error, Failure, Limits, Request}; | |
| 3 | 추가: | |
| 4 | 추가: pub fn fixture(name: &str) -> Vec<u8> { | |
| 5 | 추가: let line = include_str!("fixtures.hex") | |
| 6 | 추가: .lines() | |
| 7 | 추가: .find_map(|line| { | |
| 8 | 추가: let (key, value) = line.split_once(':').unwrap(); | |
| 9 | 추가: (key == name).then_some(value) | |
| 10 | 추가: }) | |
| 11 | 추가: .expect("고정 fixture가 있어야 함"); | |
| 12 | 추가: line.as_bytes() | |
| 13 | 추가: .chunks_exact(2) | |
| 14 | 추가: .map(|pair| u8::from_str_radix(std::str::from_utf8(pair).unwrap(), 16).unwrap()) | |
| 15 | 추가: .collect() | |
| 16 | 추가: } | |
| 17 | 추가: | |
| 18 | 추가: pub fn normal() -> Vec<u8> { | |
| 19 | 추가: fixture("flags_00") | |
| 20 | 추가: } | |
| 21 | 추가: | |
| 22 | 추가: pub fn bad_after_output() -> Vec<u8> { | |
| 23 | 추가: let mut bytes = fixture("byte_a"); | |
| 24 | 추가: bytes[10] = 0; | |
| 25 | 추가: bytes.insert(16, 7); | |
| 26 | 추가: bytes | |
| 27 | 추가: } | |
| 28 | 추가: | |
| 29 | 추가: pub fn request(bytes: &[u8], selected: bool) -> Request { | |
| 30 | 추가: Request { | |
| 31 | 추가: input: bytes.to_vec().into_boxed_slice(), | |
| 32 | 추가: selected, | |
| 33 | 추가: } | |
| 34 | 추가: } | |
| 35 | 추가: | |
| 36 | 추가: pub fn budget() -> Budget { | |
| 37 | 추가: Budget::new(Limits::default()).unwrap() | |
| 38 | 추가: } | |
| 39 | 추가: | |
| 40 | 추가: pub fn read( | |
| 41 | 추가: bytes: &[u8], | |
| 42 | 추가: selected: bool, | |
| 43 | 추가: budget: &mut Budget, | |
| 44 | 추가: ) -> Result<Completed, Error<Infallible>> { | |
| 45 | 추가: zipelo_memory_gzip_reader::read(request(bytes, selected), budget, |_| Ok(())) | |
| 46 | 추가: } | |
| 47 | 추가: | |
| 48 | 추가: pub fn reader_error<E: std::fmt::Debug>(result: Result<Completed, Error<E>>, expected: Failure) { | |
| 49 | 추가: match result { | |
| 50 | 추가: Err(Error::Reader(actual)) => assert_eq!(actual, expected), | |
| 51 | 추가: other => panic!("완료 결과 없이 {expected:?} 오류여야 함: {other:?}"), | |
| 52 | 추가: } | |
| 53 | 추가: } | |
| 54 | 추가: | |
| 55 | 추가: pub fn assert_valid( | |
| 56 | 추가: name: &str, | |
| 57 | 추가: selected: bool, | |
| 58 | 추가: payload: &[u8], | |
| 59 | 추가: header: usize, | |
| 60 | 추가: raw: usize, | |
| 61 | 추가: crc: u32, | |
| 62 | 추가: ) { | |
| 63 | 추가: let bytes = fixture(name); | |
| 64 | 추가: let mut limits = budget(); | |
| 65 | 추가: let result = read(&bytes, selected, &mut limits).unwrap(); | |
| 66 | 추가: assert_eq!(result.bytes, selected.then(|| payload.to_vec())); | |
| 67 | 추가: assert_eq!(result.boundary.header_bytes, header); | |
| 68 | 추가: assert_eq!(result.boundary.deflate_bytes, raw as u64); | |
| 69 | 추가: assert_eq!(result.boundary.inflated_bytes, payload.len() as u64); | |
| 70 | 추가: assert_eq!(result.boundary.crc32, crc); | |
| 71 | 추가: assert_eq!(result.boundary.member_bytes, bytes.len()); | |
| 72 | 추가: assert!(result.boundary.offered_bytes >= raw as u64); | |
| 73 | 추가: assert!(result.boundary.offered_bytes <= (raw + 8) as u64); | |
| 74 | 추가: assert_eq!( | |
| 75 | 추가: result.boundary.read_ahead_bytes as u64, | |
| 76 | 추가: result.boundary.offered_bytes - raw as u64 | |
| 77 | 추가: ); | |
| 78 | 추가: assert_eq!(result.usage.processed, (bytes.len() + payload.len()) as u64); | |
| 79 | 추가: assert_eq!( | |
| 80 | 추가: result.usage.output, | |
| 81 | 추가: if selected { payload.len() as u64 } else { 0 } | |
| 82 | 추가: ); | |
| 83 | 추가: assert_eq!(result.usage.metadata, header as u64); | |
| 84 | 추가: assert_eq!(result.usage, limits.usage()); | |
| 85 | 추가: } |