Skip to content

Commit 6f30512

Browse files
committed
rename project to fluxsort
1 parent 21c8037 commit 6f30512

41 files changed

Lines changed: 141 additions & 141 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/literature-review-task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Explain what wording, comparison, or novelty risk this review is meant to clarif
1616

1717
## Questions to answer
1818

19-
- [ ] What is the closest overlap with AdicFlux?
19+
- [ ] What is the closest overlap with FluxSort?
2020
- [ ] What is the strongest difference?
2121
- [ ] Does this affect current README/docs wording?
2222
- [ ] Should it be cited in `docs/positioning.md` later?

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# AdicFlux
1+
# FluxSort
22

3-
AdicFlux is an experimental integer sorting algorithm in Zig built around exact local transport guided by a weighted 2-adic pressure field.
3+
FluxSort is an experimental integer sorting algorithm in Zig built around exact local transport guided by a weighted 2-adic pressure field.
44

55
![Representative benchmark comparison](docs/assets/representative-comparison.svg)
66

@@ -15,7 +15,7 @@ This repository is worth reading as an algorithm experiment, benchmark trail, an
1515

1616
## Algorithm Sketch
1717

18-
AdicFlux sorts signed integers with four core ideas:
18+
FluxSort sorts signed integers with four core ideas:
1919

2020
1. Convert signed integers to order-preserving biased unsigned keys.
2121
2. Compute a local pressure field inside each block from nearby comparisons.
@@ -74,7 +74,7 @@ See `docs/findings.md` for the condensed research trail.
7474

7575
The current stable implementation does not beat the standard-library baseline on the representative full-sort cases below.
7676

77-
| Dataset | Size | AdicFlux | `std.sort.pdq` |
77+
| Dataset | Size | FluxSort | `std.sort.pdq` |
7878
| --- | ---: | ---: | ---: |
7979
| `duplicate_heavy` | 1024 | 360123 ns | 1253 ns |
8080
| `duplicate_heavy` | 4096 | 3481692 ns | 3678 ns |
@@ -87,7 +87,7 @@ The current stable implementation does not beat the standard-library baseline on
8787

8888
Interpretation:
8989

90-
- AdicFlux has a meaningful internal optimization story.
90+
- FluxSort has a meaningful internal optimization story.
9191
- It does not have a competitive benchmark story against strong mainstream baselines.
9292
- The grouped duplicate-heavy path is interesting as an algorithm-specific milestone, not as evidence of overall speed.
9393

@@ -132,31 +132,31 @@ Focused benchmark example:
132132
## Basic Usage
133133

134134
```zig
135-
const adicflux = @import("adicflux");
135+
const fluxsort = @import("fluxsort");
136136
137137
var xs = [_]i64{ 9, -3, 4, 4, 0, -9, 7 };
138-
adicflux.sort(i64, xs[0..]);
138+
fluxsort.sort(i64, xs[0..]);
139139
```
140140

141141
With explicit configuration:
142142

143143
```zig
144-
const cfg = adicflux.Config{
144+
const cfg = fluxsort.Config{
145145
.block_size = 32,
146146
.valuation_cap = 8,
147147
.neighborhood = 8,
148148
.max_displacement = 4,
149149
.transport_rounds = 4,
150150
};
151151
152-
adicflux.sortWithConfig(i64, xs[0..], cfg);
152+
fluxsort.sortWithConfig(i64, xs[0..], cfg);
153153
```
154154

155155
`cleanup_pass_limit` remains available for diagnostic runs; leaving it as `null` preserves the exactness guarantee.
156156

157157
## Repository Layout
158158

159-
- `src/adicflux.zig` public API
159+
- `src/fluxsort.zig` public API
160160
- `src/core/` pressure, energy, transport, cleanup, and configuration code
161161
- `test/` unit and property tests
162162
- `bench/main.zig` local benchmark harness
@@ -165,4 +165,4 @@ adicflux.sortWithConfig(i64, xs[0..], cfg);
165165

166166
## Final Assessment
167167

168-
AdicFlux is an interesting experimental generic integer sorting algorithm with one meaningful optimization milestone and a substantial trail of tested ideas. It is exact, unusual, and reasonably well-documented. It has not been shown to beat relevant baselines, and this repository should be read as a research artifact rather than a production sorting library.
168+
FluxSort is an interesting experimental generic integer sorting algorithm with one meaningful optimization milestone and a substantial trail of tested ideas. It is exact, unusual, and reasonably well-documented. It has not been shown to beat relevant baselines, and this repository should be read as a research artifact rather than a production sorting library.

bench/main.zig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const std = @import("std");
2-
const adicflux = @import("adicflux");
2+
const fluxsort = @import("fluxsort");
33

4-
const support = adicflux.unstable_test_support;
4+
const support = fluxsort.unstable_test_support;
55
const Stats = support.stats.Stats;
6-
const Config = adicflux.Config;
6+
const Config = fluxsort.Config;
77

88
const Dataset = enum {
99
random,
@@ -154,11 +154,11 @@ fn validateCase(allocator: std.mem.Allocator, input: []const i32, cfg: Config) !
154154
support.sortWithStats(i32, actual, cfg, &stats);
155155

156156
if (!std.mem.eql(i32, expected, actual)) return error.BenchmarkValidationFailed;
157-
if (!adicflux.isSorted(i32, actual)) return error.BenchmarkValidationFailed;
157+
if (!fluxsort.isSorted(i32, actual)) return error.BenchmarkValidationFailed;
158158
return stats;
159159
}
160160

161-
fn timeAdicFlux(allocator: std.mem.Allocator, input: []const i32, cfg: Config, iterations: usize) !Result {
161+
fn timeFluxSort(allocator: std.mem.Allocator, input: []const i32, cfg: Config, iterations: usize) !Result {
162162
const scratch = try allocator.alloc(i32, input.len);
163163
defer allocator.free(scratch);
164164

@@ -168,12 +168,12 @@ fn timeAdicFlux(allocator: std.mem.Allocator, input: []const i32, cfg: Config, i
168168
var iter: usize = 0;
169169
while (iter < iterations) : (iter += 1) {
170170
@memcpy(scratch, input);
171-
adicflux.sort(i32, scratch);
171+
fluxsort.sort(i32, scratch);
172172
}
173173
const total_ns = timer.read();
174174

175175
return .{
176-
.algo = "adicflux",
176+
.algo = "fluxsort",
177177
.dataset = undefined,
178178
.size = input.len,
179179
.iterations = iterations,
@@ -273,11 +273,11 @@ pub fn main() !void {
273273

274274
const sizes = [_]usize{ 32, 64, 128, 256, 512, 1024, 2048, 4096 };
275275
const datasets = [_]Dataset{ .random, .sorted, .reverse, .nearly_sorted, .duplicate_heavy, .clustered, .signed_mixed, .alternating };
276-
const cfg = adicflux.DefaultConfig;
276+
const cfg = fluxsort.DefaultConfig;
277277
var prng = std.Random.DefaultPrng.init(0xad1cf1);
278278
const random = prng.random();
279279

280-
try writer.print("# adicflux benchmark harness\n", .{});
280+
try writer.print("# fluxsort benchmark harness\n", .{});
281281
try writer.print("# zig_version,{s}\n", .{@import("builtin").zig_version_string});
282282
try writer.print("# optimize_mode,{s}\n", .{@tagName(@import("builtin").mode)});
283283
try writer.print("algo,dataset,size,iterations,total_ns,avg_ns,avg_ns_per_item,transport_accepted,transport_rejected,grouped_exact_blocks,moved_delta_blocks,full_delta_blocks,cleanup_rounds,cleanup_swaps\n", .{});
@@ -292,7 +292,7 @@ pub fn main() !void {
292292

293293
const iterations = filters.iterations_override orelse chooseIterations(size);
294294

295-
var adic_result = try timeAdicFlux(allocator, input, cfg, iterations);
295+
var adic_result = try timeFluxSort(allocator, input, cfg, iterations);
296296
adic_result.dataset = dataset;
297297
try printResult(writer, adic_result, dataset);
298298

build.zig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ pub fn build(b: *std.Build) void {
44
const target = b.standardTargetOptions(.{});
55
const optimize = b.standardOptimizeOption(.{});
66

7-
const adicflux_mod = b.createModule(.{
7+
const fluxsort_mod = b.createModule(.{
88
.root_source_file = b.path("src/lib.zig"),
99
.target = target,
1010
.optimize = optimize,
1111
});
1212

1313
const lib = b.addLibrary(.{
1414
.linkage = .static,
15-
.name = "adicflux",
16-
.root_module = adicflux_mod,
15+
.name = "fluxsort",
16+
.root_module = fluxsort_mod,
1717
});
1818
b.installArtifact(lib);
1919

@@ -22,10 +22,10 @@ pub fn build(b: *std.Build) void {
2222
.target = target,
2323
.optimize = optimize,
2424
});
25-
exe_mod.addImport("adicflux", adicflux_mod);
25+
exe_mod.addImport("fluxsort", fluxsort_mod);
2626

2727
const exe = b.addExecutable(.{
28-
.name = "adicflux-demo",
28+
.name = "fluxsort-demo",
2929
.root_module = exe_mod,
3030
});
3131
b.installArtifact(exe);
@@ -42,7 +42,7 @@ pub fn build(b: *std.Build) void {
4242
.target = target,
4343
.optimize = optimize,
4444
});
45-
example_mod.addImport("adicflux", adicflux_mod);
45+
example_mod.addImport("fluxsort", fluxsort_mod);
4646

4747
const example_exe = b.addExecutable(.{
4848
.name = "basic_sort",
@@ -58,25 +58,25 @@ pub fn build(b: *std.Build) void {
5858
.target = target,
5959
.optimize = optimize,
6060
});
61-
tests_mod.addImport("adicflux", adicflux_mod);
61+
tests_mod.addImport("fluxsort", fluxsort_mod);
6262

6363
const tests = b.addTest(.{
6464
.root_module = tests_mod,
6565
});
6666
const run_tests = b.addRunArtifact(tests);
6767

68-
const test_step = b.step("test", "Run AdicFlux tests");
68+
const test_step = b.step("test", "Run FluxSort tests");
6969
test_step.dependOn(&run_tests.step);
7070

7171
const bench_mod = b.createModule(.{
7272
.root_source_file = b.path("bench/main.zig"),
7373
.target = target,
7474
.optimize = optimize,
7575
});
76-
bench_mod.addImport("adicflux", adicflux_mod);
76+
bench_mod.addImport("fluxsort", fluxsort_mod);
7777

7878
const bench_exe = b.addExecutable(.{
79-
.name = "adicflux-bench",
79+
.name = "fluxsort-bench",
8080
.root_module = bench_mod,
8181
});
8282

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// It is redundant to include "zig" in this name because it is already
88
// within the Zig package namespace.
9-
.name = .AdicFlux,
9+
.name = .FluxSort,
1010

1111
// This is a [Semantic Version](https://semver.org/).
1212
// In a future version of Zig it will be used for package deduplication.
@@ -24,7 +24,7 @@
2424
// original project's identity. Thus it is recommended to leave the comment
2525
// on the following line intact, so that it shows up in code reviews that
2626
// modify the field.
27-
.fingerprint = 0xfda167fb8d1aa117, // Changing this has security and trust implications.
27+
.fingerprint = 0x84d987ee2e833367, // Changing this has security and trust implications.
2828

2929
// Tracks the earliest Zig version that the package considers to be a
3030
// supported use case.

docs/algorithm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For unsigned integers, the key is the value itself.
1010

1111
For indices `i < j`, an inversion contributes energy when `key(xs[i]) > key(xs[j])`.
1212

13-
The baseline contribution is `1`. AdicFlux adds a capped 2-adic closeness bonus:
13+
The baseline contribution is `1`. FluxSort adds a capped 2-adic closeness bonus:
1414

1515
- compute `key(xs[i]) xor key(xs[j])`,
1616
- take `ctz(...)`,
@@ -44,7 +44,7 @@ That is a local acceptance criterion. In the current repository it should not be
4444

4545
## 5. Exact cleanup stage
4646

47-
After transport rounds finish, AdicFlux runs odd-even adjacent cleanup until no swaps remain. This is the exact stage. With the default configuration, it guarantees that the final output is sorted even if every transport proposal is rejected.
47+
After transport rounds finish, FluxSort runs odd-even adjacent cleanup until no swaps remain. This is the exact stage. With the default configuration, it guarantees that the final output is sorted even if every transport proposal is rejected.
4848

4949
The configuration also exposes `cleanup_pass_limit` for diagnostic runs. Using a finite limit intentionally weakens that guarantee because cleanup may stop before the array is sorted.
5050

docs/api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
pub fn sort(comptime T: type, xs: []T) void
99
```
1010

11-
Sorts an integer slice in place using the default AdicFlux configuration.
11+
Sorts an integer slice in place using the default FluxSort configuration.
1212

1313
### `sortWithConfig`
1414

@@ -26,7 +26,7 @@ Invalid configurations panic with the validation error name. This keeps the publ
2626
pub fn isSorted(comptime T: type, xs: []const T) bool
2727
```
2828

29-
Checks whether a slice is nondecreasing under AdicFlux's key ordering.
29+
Checks whether a slice is nondecreasing under FluxSort's key ordering.
3030

3131
`isSorted` is an intentional part of the public API. It exists as a small validation helper for examples, tests, and user code that experiments with non-default configurations such as `cleanup_pass_limit`, where a caller may intentionally request a diagnostic run that does not complete the exact cleanup stage.
3232

@@ -63,6 +63,6 @@ Optional diagnostic/testing limit for odd-even cleanup rounds.
6363

6464
## Non-stable internal support
6565

66-
Internal modules used by the test suite are exposed under `adicflux.unstable_test_support`.
66+
Internal modules used by the test suite are exposed under `fluxsort.unstable_test_support`.
6767

6868
That namespace exists for repository development and tests. It is intentionally non-stable and may change without notice.

docs/assets/internal-milestone.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/assets/representative-comparison.svg

Lines changed: 7 additions & 7 deletions
Loading

docs/benchmark-summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Pre-milestone comparison was collected from `46f9743` in a temporary worktree us
2222

2323
## Representative Stable Numbers (`7d12617`)
2424

25-
| Dataset | Size | AdicFlux | `std.sort.pdq` |
25+
| Dataset | Size | FluxSort | `std.sort.pdq` |
2626
| --- | ---: | ---: | ---: |
2727
| `duplicate_heavy` | 1024 | 360123 ns | 1253 ns |
2828
| `duplicate_heavy` | 4096 | 3481692 ns | 3678 ns |

0 commit comments

Comments
 (0)