<feed xmlns='http://www.w3.org/2005/Atom'>
<title>eglantine-cirakg/src/common/zstd_compression.cpp, branch nx2</title>
<subtitle>Mirror of github.com/cira0100/Eglantine-public nx2, a fork of Djihads80/Eglantine.</subtitle>
<id>https://git.cirakg.xyz/eglantine-cirakg/atom?h=nx2</id>
<link rel='self' href='https://git.cirakg.xyz/eglantine-cirakg/atom?h=nx2'/>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/'/>
<updated>2026-11-03T00:39:54+00:00</updated>
<entry>
<title>network: close each bsd fd once and drop unwanted or malformed room packets</title>
<updated>2026-11-03T00:39:54+00:00</updated>
<author>
<name>cirakg</name>
<email>cirakg@cirakg.xyz</email>
</author>
<published>2026-11-03T00:39:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=4304d2704a57c22d5b3f8576b5acebc57a6a7eef'/>
<id>urn:sha1:4304d2704a57c22d5b3f8576b5acebc57a6a7eef</id>
<content type='text'>
Two threads closing the same fd both copied the descriptor and both called
Close(), so a host socket could be closed twice, and the second closesocket
could hit an unrelated socket that had reused the host fd. CloseImpl now
frees the slot under file_descriptors_mutex first and only that thread closes
the socket; the other gets EBADF.

OnProxyPacketReceived decompressed every room packet when any fd had a
socket, including native sockets and proxy sockets on other ports. Sockets
now report through AcceptsProxyPacket whether they want a packet, and only
those are collected, so an unwanted packet is not decompressed.

DecompressDataZSTD passed the frame's declared size straight to the vector
constructor, so a malformed or unsized frame from a room member threw on the
room thread. The new TryDecompressDataZSTD rejects invalid, unsized and
oversized frames, and bsd drops such packets with a warning.
DecompressDataZSTD now returns an empty vector for them instead of throwing.

Assisted-by: Claude Opus 5.5 (investigation and implementation)
</content>
</entry>
<entry>
<title>[core] Support block-compressed NSZ and XCZ (#4552)</title>
<updated>2026-10-26T16:23:18+00:00</updated>
<author>
<name>PavelBARABANOV</name>
<email>pavelbarabanov94@gmail.com</email>
</author>
<published>2026-10-26T16:23:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=58968bd1274d8ebb1f159ad31500dde8d74abea6'/>
<id>urn:sha1:58968bd1274d8ebb1f159ad31500dde8d74abea6</id>
<content type='text'>
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md).
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------
- Add NCZBLOCK (nsz -B / .xcz) reader: each read decodes only the covered blocks and re-encrypts CTR sections, no disk output.
- Allow installing solid .nsz to NAND via DecompressNCZForInstall (lazy, incremental decode with frontier, O(n) instead of O(n^2)).
- Accept BKTR updates with thousands of sections (MaxSectionCount = 0x10000).
- Wire .nsz/.xcz into loader, registered cache, scanner, and NAND install (content_manager.h), and reject solid NCZ from the game list.
- Bump the pinned zstd to 33618c8 in cpmfile.json, which includes the upstream AArch64 revert ([33618c89](https://github.com/facebook/zstd/commit/33618c89e511637f8a6ef955b3501766d71feb53)) for a ZSTD_decodeSequence branch optimization that could corrupt data on ARM64; without it, solid NCZ decoding on Android fails with "Data corruption detected".

NCZ format and CTR counter semantics follow the reference nsz tool and its
Rust port:
- https://github.com/nicoboss/nsz (Decompressor.py, BlockDecompressorReader.py)
- https://docs.rs/nsz-rs/0.3.0/src/nsz_rs/decompress.rs.html

The last-block edge case (decompressed size is an exact multiple of block
size) is handled as described in https://github.com/nicoboss/nsz/issues/210

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4552
Reviewed-by: CamilleLaVey &lt;camillelavey99@gmail.com&gt;
Reviewed-by: Shinmegumi &lt;shinmegumi@eden-emu.dev&gt;
</content>
</entry>
<entry>
<title>zstd: Use ZSTD_getFrameContentSize instead of ZSTD_getDecompressedSize</title>
<updated>2023-03-24T02:16:20+00:00</updated>
<author>
<name>Morph</name>
<email>39850852+Morph1984@users.noreply.github.com</email>
</author>
<published>2023-03-24T02:16:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=79aa81015f6366c6ef635da2f34a97c5bc69475c'/>
<id>urn:sha1:79aa81015f6366c6ef635da2f34a97c5bc69475c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>general: Convert source file copyright comments over to SPDX</title>
<updated>2022-04-23T09:55:32+00:00</updated>
<author>
<name>Morph</name>
<email>39850852+Morph1984@users.noreply.github.com</email>
</author>
<published>2022-04-23T08:59:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=2b87305d319f0bd04da36fb96314934f37b12637'/>
<id>urn:sha1:2b87305d319f0bd04da36fb96314934f37b12637</id>
<content type='text'>
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
</content>
</entry>
<entry>
<title>zstd_compression: Make use of std::span</title>
<updated>2021-05-24T19:01:04+00:00</updated>
<author>
<name>Lioncash</name>
<email>mathew1800@gmail.com</email>
</author>
<published>2021-05-24T09:32:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=e6e865f3d394213ba85be527e0534bcebc9128e1'/>
<id>urn:sha1:e6e865f3d394213ba85be527e0534bcebc9128e1</id>
<content type='text'>
Allows for the incoming data stream to be non-allocating.
</content>
</entry>
<entry>
<title>common/compression: Roll back std::span changes</title>
<updated>2020-08-15T21:17:56+00:00</updated>
<author>
<name>Lioncash</name>
<email>mathew1800@gmail.com</email>
</author>
<published>2020-08-15T09:25:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=0977ef7d7faa4c6338eff0c58b8dd505b9afe3bb'/>
<id>urn:sha1:0977ef7d7faa4c6338eff0c58b8dd505b9afe3bb</id>
<content type='text'>
Seems like all compilers don't support std::span yet.
</content>
</entry>
<entry>
<title>zstd_compression: Make use of std::span in interfaces</title>
<updated>2020-07-25T07:11:56+00:00</updated>
<author>
<name>Lioncash</name>
<email>mathew1800@gmail.com</email>
</author>
<published>2020-07-25T07:11:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=84e6115423b0624ea716093a9042ab227ce96cea'/>
<id>urn:sha1:84e6115423b0624ea716093a9042ab227ce96cea</id>
<content type='text'>
Allows condensing the data and size parameters into a single argument.
</content>
</entry>
<entry>
<title>common/zstd_compression: Remove #pragma once directive from source file</title>
<updated>2019-05-04T05:54:29+00:00</updated>
<author>
<name>Lioncash</name>
<email>mathew1800@gmail.com</email>
</author>
<published>2019-05-04T05:54:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=0f099b0fd300a62f4518373dce5cffcfd080bcaa'/>
<id>urn:sha1:0f099b0fd300a62f4518373dce5cffcfd080bcaa</id>
<content type='text'>
Introduced in 2d755221e8bb1e9d3f72e214d9f46a14cdc4971b. This is only
necessary within header files.
</content>
</entry>
<entry>
<title>common/zstd_compression: simplify decompression interface</title>
<updated>2019-03-29T17:22:08+00:00</updated>
<author>
<name>unknown</name>
<email>FreddyFunk@users.noreply.github.com</email>
</author>
<published>2019-02-10T09:28:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=ef49a1b96e3d5888d07cd1fb6187c3790784baa7'/>
<id>urn:sha1:ef49a1b96e3d5888d07cd1fb6187c3790784baa7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>common/zstd_compression: Add Zstandard wrapper</title>
<updated>2019-03-29T17:22:08+00:00</updated>
<author>
<name>unknown</name>
<email>FreddyFunk@users.noreply.github.com</email>
</author>
<published>2019-02-08T22:11:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=2d755221e8bb1e9d3f72e214d9f46a14cdc4971b'/>
<id>urn:sha1:2d755221e8bb1e9d3f72e214d9f46a14cdc4971b</id>
<content type='text'>
</content>
</entry>
</feed>
