#!/usr/bin/env python3 """One interpreter start for the argument-taking half of 99-python3-pyzstd. Emits `key=value' lines, one per line, in file order; the suite reads them with grep. A python3 start on this arm is tens of seconds and every measurement here is a zstd call over at most 300 kB -- milliseconds beside the start -- so taking the start ONCE is the difference between a half-minute suite and a ten-minute one. THE TRANSPORT RULES. The runner parses its input line by line, so no value may contain a NEWLINE; the suite splits on the FIRST `=', so a value containing `=' is safe and a key containing one is not. Every key emitted here is `[a-z0-9_]+' and every value is a decimal, a hex digit string, or one of `yes'/`no'/a class name. THIS PROBE CALLS NO `METH_NOARGS' METHOD, AND THAT IS THE WHOLE REASON IT IS SPLIT FROM ITS SIBLINGS. Until brintos/linux-in-the-browser work item 186 was fixed, a main-side vectorcall into a `dlopen'd extension at a METH_NOARGS site was refused by the F152 dispatch consult and trapped the INTERPRETER -- `RuntimeError: unreachable', rc=132 -- which no `try' can catch. Should that regress, one such call anywhere in here would take every measurement below with it and report the port as broken when the argument-taking surface is fine. So the four NOARGS arms live in python3-pyzstd-noargs.py, one interpreter start each, and this file stays clear of them. WHERE THE EXPECTED VALUES COME FROM. Every expectation the suite compares against was measured on an x86-64 CONTROL built from the same sdist -- the 0.15.10 tarball whose sha256 the recipe pins, 83603a97fdbcf2139f475c940789f09e32703f931f29f4a8ddf3551e6700108b -- and NOT read off the source. The five `V_*' frames below are that control's output, embedded here as literals: decompressing them is an assertion against a frame THIS ARM DID NOT PRODUCE, which a round trip can never make. A compressor and a decompressor that were wrong in the same way would agree with each other perfectly and pass every round trip that could be written. COMPRESSED OUTPUT IS DELIBERATELY NOT PINNED BY ITS BYTES. zstd's frame format is fixed, but this arm is 32-bit where the control is 64-bit, and pinning an output hash across that boundary would report a legitimate difference as a regression. What pins the compressor instead is the suite's cross-check against the image's own `zstd' CLI -- an independent implementation of the same format on the same arm -- for which this probe writes the fixtures named by argv[1]. """ import binascii import os import random import sys emitted = [] def emit(key, value): emitted.append(key) print('%s=%s' % (key, value)) def cls(fn, *a, **kw): """The exception class fn raises, or `accepted' when it returns.""" try: fn(*a, **kw) return 'accepted' except BaseException as exc: # noqa: BLE001 - the class IS the value return type(exc).__name__ WORK = sys.argv[1] if len(sys.argv) > 1 else None # ------------------------------------------------------------------ import --- # THE PLATFORM GATE. This image's python3 is a dynamic main that must `dlopen' # pyzstd/c/_zstd.cpython-312.so and bind its CPython API imports against the # interpreter, which publishes its C API for them. Unlike crc32c's twelve this # set includes PyType_FromModuleAndSpec, PyObject_VectorcallMethod and the # PyThread_* four, so a partial publication shows up here rather than later. # # pyzstd has NO pure-Python fallback to degrade to: pyzstd/__init__.py tries # `from .c import *', falls back to `from .cffi import *' -- itself an # out-of-line CFFI extension needing _cffi_backend -- and otherwise raises its # own "Can't import compiled .so/.pyd file". The recipe builds the C backend # only, so the second branch is not even on the image. try: import pyzstd as m emit('import_ok', 'yes') emit('import_error', '') except BaseException as exc: # noqa: BLE001 emit('import_ok', 'no') emit('import_error', '%s: %s' % (type(exc).__name__, str(exc).replace('\n', ' ')[:200])) emit('emitted_count', str(len(emitted) + 1)) emit('probe_done', 'yes') sys.exit(0) # ---------------------------------------------------------------- identity --- # WHICH COPY ANSWERED, and which BACKEND. Without these the measurements below # would be statements about whatever was first on sys.path, and about a backend # nobody named. emit('module_file', getattr(m, '__file__', '')) emit('version', getattr(m, '__version__', '')) emit('all_count', str(len(m.__all__))) from pyzstd import c as _cbackend # noqa: E402 - after the gate emit('backend_file', getattr(_cbackend, '__file__', '')) _ext = getattr(_cbackend._zstd, '__file__', '') emit('ext_file', _ext) emit('ext_is_so', 'yes' if str(_ext).endswith('.so') else 'no') # The CFFI backend is NOT built by this recipe. Asserted as an absence so a # later recipe that started shipping it is a visible change: it would be a second # compiled extension needing _cffi_backend, which this image does not have. emit('has_cffi_backend', 'yes' if os.path.isdir(os.path.join(os.path.dirname(m.__file__), 'cffi')) else 'no') # ------------------------------------------------- the vendored zstd library --- # pyzstd STATICALLY links its own copy of zstd -- the recipe declares no DEPENDS # and the sdist vendors zstd/ -- so this is the vendored version, not the image's # `zstd' package. The two are independent on purpose, and the suite's # cross-check plays them against each other. emit('zstd_version', m.zstd_version) emit('zstd_version_info', '.'.join(str(x) for x in m.zstd_version_info)) # PYZSTD_CONFIG is (bitness, implementation, static-link, avx2, mremap-or-not). # The FIRST element is the pointer width the extension was compiled at, and it is # the one value here that must differ from the x86-64 control: 32, not 64. It is # the cheapest positive evidence in the suite that the module under test is this # arm's build and not a host artifact that leaked into the rootfs. _cfg = _cbackend._zstd.PYZSTD_CONFIG emit('config_bitness', str(_cfg[0])) emit('config_impl', str(_cfg[1])) emit('config_static_link', 'yes' if _cfg[2] else 'no') # Compile-time constants of the vendored library, all reached through # METH_VARARGS entry points. `compressionLevel_values' comes from # ZSTD_minCLevel/maxCLevel/defaultCLevel; the stream sizes from # ZSTD_CStreamInSize() and friends. A toolchain change that altered any of them # would silently change what "level 3" means. _lv = m.compressionLevel_values emit('clevel_default', str(_lv.default)) emit('clevel_min', str(_lv.min)) emit('clevel_max', str(_lv.max)) emit('cstream_sizes', ','.join(str(x) for x in _cbackend._ZSTD_CStreamSizes)) emit('dstream_sizes', ','.join(str(x) for x in _cbackend._ZSTD_DStreamSizes)) # ZSTD_MULTITHREAD is defined by setup.py's static-link branch on every arm, so # the multi-worker code IS compiled in and nbWorkers has a non-degenerate bound. # pyzstd derives `zstd_support_multithread' from exactly that bound at import. # Reading it here is what makes `nbworkers_max' below a measurement rather than # an assumption -- and note this says the parameter is ACCEPTED, not that the # guest ever runs a second thread. emit('support_multithread', 'yes' if m.zstd_support_multithread else 'no') _nw = m.CParameter.nbWorkers.bounds() emit('nbworkers_lower', str(_nw[0])) emit('nbworkers_max_positive', 'yes' if _nw[1] > 0 else 'no') _wl = m.CParameter.windowLog.bounds() emit('windowlog_bounds', '%d,%d' % (_wl[0], _wl[1])) emit('dparam_windowlogmax_lower', str(m.DParameter.windowLogMax.bounds()[0])) # ------------------------------------------------------------- the corpus ---- # The ticket's own list: empty, one byte, every byte value, a long single-byte # run, incompressible bytes at a fixed seed, and a payload larger than the # internal buffer. `RAND' is Mersenne Twister at a named seed, which is # bit-identical on every platform CPython runs on, so the control measured the # same bytes this arm does. `RUN' and `BIG' are both over ZSTD_CStreamOutSize # (131591), which is the point of including them: they force the output buffer to # grow rather than fit. EMPTY = b'' ONE = b'Z' ALLB = bytes(range(256)) RUN = b'a' * 200000 RAND = random.Random(2034).randbytes(65536) BIG = bytes(range(256)) * 1200 CORPUS = (('empty', EMPTY), ('one', ONE), ('allbytes', ALLB), ('run', RUN), ('rand', RAND), ('big', BIG)) for _n, _d in CORPUS: emit('len_%s' % _n, str(len(_d))) # --------------------------------------------------- one-shot round trips ---- # `compress' is ZstdCompressor(...).compress(data, FLUSH_FRAME) and `decompress' # is the module-level METH_VARARGS|METH_KEYWORDS entry point. The round trip is # asserted by an equality on the ORIGINAL bytes, so a decompressor that returned # short -- the failure mode a truncated frame produces -- is a red rather than a # silently smaller answer. for _n, _d in CORPUS: _c = m.compress(_d) emit('c_len_%s' % _n, str(len(_c))) emit('rt_%s' % _n, 'yes' if m.decompress(_c) == _d else 'no') # INCOMPRESSIBLE INPUT MUST EXPAND, NOT SHRINK. 65536 bytes of Mersenne Twister # output has no structure to find, so a frame that came back SMALLER than its # input would mean the compressor had thrown data away -- and the round trip # above would still pass if the decompressor made the same mistake. emit('rand_expands', 'yes' if len(m.compress(RAND)) > len(RAND) else 'no') # A LONG RUN MUST COLLAPSE. 200000 identical bytes is the opposite bound, and it # is what proves the match finder ran at all: a compressor that emitted every # block raw would round-trip perfectly and produce ~200 kB. emit('run_ratio_under_1k', 'yes' if len(m.compress(RUN)) < 1024 else 'no') # ------------------------------------------------------- frame introspection -- # `get_frame_info' reads the frame HEADER without decompressing, so it is an # independent statement about what the compressor wrote. A one-shot frame # carries the content size; the streaming frame below does not, and the pair is # what shows the field is really being read rather than recomputed. for _n, _d in CORPUS: _fi = m.get_frame_info(m.compress(_d)) emit('fi_dsize_%s' % _n, str(_fi.decompressed_size)) emit('fi_dictid_%s' % _n, str(_fi.dictionary_id)) emit('fsize_%s' % _n, str(m.get_frame_size(m.compress(_d)))) # ---------------------------------------------- the incremental compressor ---- # THE TICKET ASKED FOR BYTE EQUALITY WITH THE ONE-SHOT RESULT AND THAT IS WRONG # ON A CORRECT PORT -- measured on the x86-64 control, where it does not hold # either. `compress(data)' hands the whole input to one `compress(..., # FLUSH_FRAME)' call, so the frame header can carry the content size; a # chunk-fed compressor does not know the size when it writes the header and # omits the field. The streaming frame is therefore SHORTER (265 vs 266 on the # 256-byte fixture, 23 vs 26 on the run) and cannot be byte-equal. What is # asserted instead is the claim the requirement was reaching for: the incremental # path must produce a frame that decompresses to the same bytes. for _n, _d in (('allbytes', ALLB), ('run', RUN), ('big', BIG), ('rand', RAND)): _co = m.ZstdCompressor() _out = b'' for _i in range(0, len(_d), 97): _out += _co.compress(_d[_i:_i + 97]) _out += _co.flush(m.ZstdCompressor.FLUSH_FRAME) emit('inc_rt_%s' % _n, 'yes' if m.decompress(_out) == _d else 'no') emit('inc_nosize_%s' % _n, 'yes' if m.get_frame_info(_out).decompressed_size is None else 'no') # 97 is not a divisor of any fixture length, so the last chunk is short and the # stride straddles every internal block boundary rather than landing on one. # -------------------------------------------- the incremental decompressor ---- # Fed 13 bytes at a time, which is smaller than a frame header, so the # decompressor has to hold state across calls that produce no output at all. # `eof' and `needs_input' are read AS ATTRIBUTES, not called -- both are getsets, # not methods, so nothing here reaches a vectorcall site. _c = m.compress(BIG) _de = m.ZstdDecompressor() _out = b'' for _i in range(0, len(_c), 13): _out += _de.decompress(_c[_i:_i + 13]) emit('dec_chunked_rt', 'yes' if _out == BIG else 'no') emit('dec_eof', 'yes' if _de.eof else 'no') emit('dec_needs_input', 'yes' if _de.needs_input else 'no') # EndlessZstdDecompressor is the multi-frame form: two frames concatenated must # come back as one stream, where ZstdDecompressor stops at the first frame's end. _two = m.compress(ALLB) + m.compress(ONE) _ed = m.EndlessZstdDecompressor() emit('endless_rt', 'yes' if _ed.decompress(_two) == ALLB + ONE else 'no') _sd = m.ZstdDecompressor() emit('single_stops_at_frame', 'yes' if _sd.decompress(_two) == ALLB else 'no') # ------------------------------------------------------- external vectors ----- # FRAMES THIS ARM DID NOT PRODUCE. Measured on the x86-64 control at the same # version and embedded verbatim; decompressing them tests the decompressor # against the fixed zstd format rather than against this build's own compressor. # Five shapes, each reaching a different path: # # V_EMPTY a zero-content frame -- 9 bytes, header and end marker only # V_ONE a single literal byte # V_RUN 26 bytes that expand to 200000 -- the output buffer must grow # V_STREAM the same run written WITHOUT a content size, so the decompressor # cannot preallocate and must size as it goes # V_CKSUM the run again with checksumFlag set: a 4-byte XXH64 trailer the # decompressor must verify rather than skip V_EMPTY = binascii.unhexlify('28b52ffd2000010000') V_ONE = binascii.unhexlify('28b52ffd20010900005a') V_RUN = binascii.unhexlify( '28b52ffda0400d03005400001061610100fbff39c002036a0861') V_STREAM = binascii.unhexlify( '28b52ffd00585400001061610100fbff39c002036a0861') V_CKSUM = binascii.unhexlify( '28b52ffda4400d03005400001061610100fbff39c002036a08618356bc98') emit('vec_empty', 'yes' if m.decompress(V_EMPTY) == EMPTY else 'no') emit('vec_one', 'yes' if m.decompress(V_ONE) == ONE else 'no') emit('vec_run', 'yes' if m.decompress(V_RUN) == RUN else 'no') emit('vec_stream', 'yes' if m.decompress(V_STREAM) == RUN else 'no') emit('vec_cksum', 'yes' if m.decompress(V_CKSUM) == RUN else 'no') emit('vec_stream_nosize', 'yes' if m.get_frame_info(V_STREAM).decompressed_size is None else 'no') emit('vec_cksum_len', str(len(V_CKSUM))) # A CORRUPTED CHECKSUM MUST BE CAUGHT. The last byte of V_CKSUM is part of the # XXH64 trailer; flipping it leaves a frame whose content decodes perfectly and # whose checksum does not match. A decompressor that skipped the trailer would # return the right bytes and this case is the only thing that would notice. _bad_ck = V_CKSUM[:-1] + bytes([V_CKSUM[-1] ^ 0xFF]) emit('cksum_detects_flip', cls(m.decompress, _bad_ck)) # ------------------------------------------------------------- the levels ----- # THE TICKET ASKED THAT LEVELS 1 AND 19 DIFFER IN OUTPUT. That is true of a # compressible payload and FALSE of `allbytes', which is 256 distinct bytes with # nothing to find: the control emits byte-identical output for it at 1, 3 and 19 # because every level stores it raw. Asserted on `run' and `big', which do # compress, and the allbytes case is recorded as the negative control rather than # dropped -- a level knob that started changing incompressible output would be # worth knowing about. for _n, _d in (('run', RUN), ('big', BIG)): _c1 = m.compress(_d, 1) _c19 = m.compress(_d, 19) emit('lvl_differ_%s' % _n, 'yes' if _c1 != _c19 else 'no') emit('lvl_agree_%s' % _n, 'yes' if m.decompress(_c1) == _d and m.decompress(_c19) == _d else 'no') emit('lvl19_not_larger_%s' % _n, 'yes' if len(_c19) <= len(_c1) else 'no') emit('lvl_same_allbytes', 'yes' if m.compress(ALLB, 1) == m.compress(ALLB, 19) else 'no') # THE ADVANCED API MUST REPRODUCE THE LEVEL ARGUMENT EXACTLY. `compress(d, 19)' # and `compress(d, {CParameter.compressionLevel: 19})' take different paths into # ZSTD_CCtx_setParameter and must land on the same frame, byte for byte -- an # equality between two results of THIS build, so it is arm-independent and can be # asserted as bytes where a cross-arm hash cannot. for _lv in (1, 19): emit('cparam_matches_level_%d' % _lv, 'yes' if m.compress(RUN, _lv) == m.compress(RUN, {m.CParameter.compressionLevel: _lv}) else 'no') # AN OUT-OF-RANGE LEVEL IS CLAMPED, NOT REFUSED, and an unknown parameter KEY is # refused -- the pair is measured on the control rather than read off the source, # because the two look like one rule and are not. ZSTD_CCtx_setParameter bounds # compressionLevel silently, so 10**9 compresses at the maximum; a key that names # no parameter has nothing to bound and raises. Pinned so the asymmetry is a # documented property rather than something a later reader rediscovers. emit('cparam_huge_level', cls(m.compress, RUN, {m.CParameter.compressionLevel: 10 ** 9})) emit('cparam_huge_level_rt', 'yes' if m.decompress( m.compress(RUN, {m.CParameter.compressionLevel: 10 ** 9})) == RUN else 'no') emit('cparam_bad_key', cls(m.compress, RUN, {999999: 1})) # -------------------------------------------------------- dictionary ---------- # THE TICKET'S CLAIM: a dictionary trained over a fixture set compresses a # matching sample SMALLER than the dictionary-free call. It is true only for # inputs small enough that the compressor cannot build its own statistics, which # is the whole point of a zstd dictionary -- so the fixtures are 1000 short # records with a shared shape, and the sample is one more of the same. Measured # on the control: 55 bytes of record go to 64 bytes plain and 30 with the # dictionary. # # The dictionary's CONTENT is not pinned. ZDICT_trainFromBuffer runs a parameter # search whose intermediate sizes are `size_t', and this arm is 32-bit where the # control is 64-bit, so the trained bytes and the dict_id derived from them may # legitimately differ. What is asserted is the property the ticket asked for and # the round trip, both of which hold whatever the trainer produced. _WORDS = (b'alpha', b'bravo', b'charlie', b'delta', b'echo', b'foxtrot', b'golf', b'hotel', b'india', b'juliet', b'kilo', b'lima', b'mike', b'november', b'oscar', b'papa') def _rec(rng): return b'{"user":"%s","host":"%s","action":"%s","rc":%d}' % ( rng.choice(_WORDS), rng.choice(_WORDS), rng.choice(_WORDS), rng.randrange(256)) _r = random.Random(2034) _samples = [_rec(_r) for _ in range(1000)] _zd = m.train_dict(_samples, 8192) emit('dict_trained', 'yes' if len(_zd.dict_content) > 0 else 'no') emit('dict_id_nonzero', 'yes' if _zd.dict_id != 0 else 'no') _r2 = random.Random(90210) _tests = [_rec(_r2) for _ in range(5)] _plain = sum(len(m.compress(_t)) for _t in _tests) _withd = sum(len(m.compress(_t, zstd_dict=_zd)) for _t in _tests) emit('dict_smaller', 'yes' if _withd < _plain else 'no') emit('dict_smaller_margin_2x', 'yes' if _withd * 2 <= _plain else 'no') emit('dict_rt', 'yes' if m.decompress(m.compress(_tests[0], zstd_dict=_zd), zstd_dict=_zd) == _tests[0] else 'no') # A DICTIONARY FRAME NAMES ITS DICTIONARY, and decompressing it without one must # FAIL rather than return plausible rubbish. Both halves are asserted: the id in # the header matches the dictionary, and the dictionary-free call raises. _dframe = m.compress(_tests[0], zstd_dict=_zd) emit('dict_frame_id_matches', 'yes' if m.get_frame_info(_dframe).dictionary_id == _zd.dict_id else 'no') emit('dict_missing_refused', cls(m.decompress, _dframe)) # finalize_dict is the other half of the dictionary API and needs zstd >= 1.4.5, # which the vendored 1.5.5 satisfies. Asserted so a future recipe that linked an # older zstd dynamically surfaces here rather than at a user's call. # # The target size must LEAVE ROOM FOR THE BASIS: finalize takes the existing # dictionary as its content and adds headers and statistics, so asking for 4096 # from an 8192-byte basis raises `Destination buffer is too small' -- measured on # the control, and a trap worth naming here because the argument reads like a # maximum rather than a floor. _fd = m.finalize_dict(_zd, _samples[:100], 16384, 3) emit('finalize_dict_ok', 'yes' if len(_fd.dict_content) > 0 else 'no') emit('finalize_dict_id_differs', 'yes' if _fd.dict_id != _zd.dict_id else 'no') # -------------------------------------------------------- error paths --------- # TRUNCATED AND CORRUPTED FRAMES MUST RAISE, NOT RETURN SHORT. A decompressor # that returned what it had decoded so far would pass every round trip in this # file and silently lose the tail of every damaged frame in production. _good = m.compress(ALLB) emit('err_truncated', cls(m.decompress, _good[:-5])) emit('err_header_only', cls(m.decompress, _good[:4])) emit('err_corrupt_body', cls(m.decompress, _good[:8] + bytes([_good[8] ^ 0xFF]) + _good[9:])) emit('err_garbage', cls(m.decompress, b'notazstdframe' * 4)) emit('err_empty_input', cls(m.decompress, b'')) emit('zstderror_is_exception', 'yes' if issubclass(m.ZstdError, Exception) else 'no') # A TRUNCATED FRAME THROUGH THE INCREMENTAL DECOMPRESSOR IS NOT AN ERROR, it is # an unfinished stream -- `eof' stays false and the object waits for more input. # The distinction matters: the one-shot call knows the frame ended early, the # incremental one cannot know the caller has no more to give. _pd = m.ZstdDecompressor() _partial = _pd.decompress(_good[:-5]) emit('partial_not_eof', 'no' if _pd.eof else 'yes') emit('partial_shorter', 'yes' if len(_partial) < len(ALLB) else 'no') # Argument-type refusals. `str' has no defined encoding to compress and must be # refused rather than silently encoded. emit('arg_str', cls(m.compress, 'not bytes')) emit('arg_none', cls(m.compress, None)) emit('arg_int_level', cls(m.compress, ALLB, 'nineteen')) # --------------------------------------------------- the buffer protocol ------ # bytes, bytearray and memoryview reach the same C code by three different paths. # A fresh extension build is where those diverge, so each is measured rather than # assumed to agree. emit('buf_bytes', 'yes' if m.decompress(m.compress(bytes(ALLB))) == ALLB else 'no') emit('buf_bytearray', 'yes' if m.decompress(m.compress(bytearray(ALLB))) == ALLB else 'no') emit('buf_memoryview', 'yes' if m.decompress(m.compress(memoryview(ALLB))) == ALLB else 'no') # -------------------------------------------- ZstdFile through METH_O only ---- # `open()' and `ZstdFile' are the ticket's file-like requirement. Every read # here passes an explicit SIZE, which routes through `ZstdFileReader.readinto' # (METH_O). A bare `read()' would route through `readall' (METH_NOARGS), which # trapped the interpreter before work item 186 was fixed, so it is not made here # -- python3-pyzstd-noargs.py makes it, alone, in a start of its own. if WORK: _p = os.path.join(WORK, 'pf.zst') with m.open(_p, 'wb') as _f: _f.write(BIG) emit('file_written', 'yes' if os.path.getsize(_p) > 0 else 'no') emit('file_smaller_than_input', 'yes' if os.path.getsize(_p) < len(BIG) else 'no') with m.open(_p, 'rb') as _f: _got = b'' while True: _chunk = _f.read(4096) if not _chunk: break _got += _chunk emit('file_rt_sized', 'yes' if _got == BIG else 'no') # ZstdFile in binary mode, the class rather than the open() helper. with m.ZstdFile(_p, 'rb') as _f: emit('file_readable', 'yes' if _f.readable() else 'no') emit('file_seekable', 'yes' if _f.seekable() else 'no') emit('file_first16', binascii.hexlify(_f.read(16)).decode()) # Text mode goes through io.TextIOWrapper over the same reader. _tp = os.path.join(WORK, 'pt.zst') with m.open(_tp, 'wt', encoding='utf-8') as _f: _f.write('brintOS pyzstd text mode\n' * 100) with m.open(_tp, 'rt', encoding='utf-8') as _f: _line = _f.readline() emit('file_text_line', _line.strip()) # THE FIXTURES FOR THE CROSS-CHECK against the image's own `zstd' CLI, which # is an independent implementation of this format on this arm. The suite # decompresses `xc-pyzstd.zst' with `zstd -d' and compares it to `xc-plain.bin' # byte for byte; that is the assertion a round trip cannot make, because a # compressor and a decompressor wrong in the same way agree with each other. with open(os.path.join(WORK, 'xc-plain.bin'), 'wb') as _f: _f.write(BIG) with open(os.path.join(WORK, 'xc-pyzstd.zst'), 'wb') as _f: _f.write(m.compress(BIG, 3)) emit('xcheck_fixtures', 'yes') else: emit('xcheck_fixtures', 'no') emit('emitted_count', str(len(emitted) + 2)) emit('probe_done', 'yes') sys.exit(0)