Skip to content

Commit fb8087b

Browse files
PABannierclaude
andcommitted
chore: prepare v1.0.0 release
Add library version defines (SAM3_VERSION_MAJOR/MINOR/PATCH) to sam3.h, set CMake project version to 1.0.0, add MIT LICENSE file, and rename internal SAM3_VERSION to SAM3_FILE_VERSION to avoid macro conflict. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent aadf1c6 commit fb8087b

4 files changed

Lines changed: 35 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.14)
2-
project(sam3.cpp LANGUAGES C CXX)
2+
project(sam3.cpp VERSION 1.0.0 LANGUAGES C CXX)
33

44
set(CMAKE_CXX_STANDARD 14)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025-2026 Pierre-Antoine Bannier
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

sam3.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
static constexpr uint32_t SAM3_MAGIC = 0x73616D33; // "sam3"
6060
static constexpr uint32_t SAM2_MAGIC = 0x73616D32; // "sam2"
6161
static constexpr uint32_t SAM3_TOK_MAGIC = 0x746F6B00; // "tok\0"
62-
static constexpr int SAM3_VERSION = 3;
62+
static constexpr int SAM3_FILE_VERSION = 3;
6363
static constexpr int SAM2_VERSION = 1;
6464

6565

@@ -3216,9 +3216,9 @@ std::shared_ptr<sam3_model> sam3_load_model(const sam3_params& params) {
32163216

32173217
bool is_sam2 = false;
32183218
if (magic == SAM3_MAGIC) {
3219-
if (version != SAM3_VERSION) {
3219+
if (version != SAM3_FILE_VERSION) {
32203220
fprintf(stderr, "%s: unsupported SAM3 version: %d (expected %d)\n",
3221-
__func__, version, SAM3_VERSION);
3221+
__func__, version, SAM3_FILE_VERSION);
32223222
return nullptr;
32233223
}
32243224
} else if (magic == SAM2_MAGIC) {
@@ -12368,7 +12368,7 @@ bool sam3_test_load_tokenizer(const std::string& model_path) {
1236812368
fin.read(reinterpret_cast<char*>(&version), 4);
1236912369
fin.read(reinterpret_cast<char*>(&ftype), 4);
1237012370
fin.read(reinterpret_cast<char*>(&n_tensors), 4);
12371-
if (magic != SAM3_MAGIC || version != SAM3_VERSION) return false;
12371+
if (magic != SAM3_MAGIC || version != SAM3_FILE_VERSION) return false;
1237212372

1237312373
// Skip hparams
1237412374
sam3_hparams hp;

sam3.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
#include <string>
66
#include <vector>
77

8+
/*
9+
** ── Version ─────────────────────────────────────────────────────────────
10+
*/
11+
12+
#define SAM3_VERSION_MAJOR 1
13+
#define SAM3_VERSION_MINOR 0
14+
#define SAM3_VERSION_PATCH 0
15+
#define SAM3_VERSION "1.0.0"
16+
817
/*
918
** ── Forward Declarations ─────────────────────────────────────────────────
1019
*/

0 commit comments

Comments
 (0)