LDPC codes with belief propagation decoding
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

wal, block, sse, zephyr: remove [mutable] from never-reassigned fields

Warning 69 (unused-field, mutable-never-assigned). Four independent
record fields were flagged as mutable but the code only mutates their
referents in place, never rebinds the record slot itself:

- ocaml-wal/lib/wal.ml: [t.file] (the Eio file resource; methods call
Eio.File.pwrite_all etc., the slot is set once at open time).
- ocaml-block/lib/block.ml: [Memory.state.data] (the backing bytes,
written via Bytes.blit_string; [Bytes.t] is already mutable).
- ocaml-sse/lib/sse.ml: [Parser.t.data_buf] (a Buffer.t, written via
Buffer.add_*; the slot never changes).
- ocaml-zephyr/lib/zephyr.ml: drop [mode : Read | Write] entirely —
set at open-time, read nowhere. The open_read / open_write
constructors already distinguish the two call shapes, so mode
tracking was redundant.

+7 -3
+3
dune
··· 1 + (env 2 + (dev 3 + (flags :standard %{dune-warnings})))
+4 -3
lib/ldpc.ml
··· 11 11 n : int; (* transmitted codeword length *) 12 12 k : int; (* information length *) 13 13 m : int; (* number of parity check equations *) 14 - n_full : int; (* full codeword length including punctured bits *) 15 - punctured : int; (* number of punctured bits *) 14 + n_full : int; 15 + (* full codeword length including punctured bits; the number of 16 + punctured bits is [n_full - n]. *) 16 17 h_rows : int array array; (* h_rows.(i) = columns with 1 in row i *) 17 18 h_cols : int array array; (* h_cols.(j) = rows with 1 in column j *) 18 19 gen_p : ··· 537 538 Array.map (fun rows -> Array.of_list (List.sort compare rows)) col_lists 538 539 in 539 540 let n = n_full - punctured in 540 - { n; k; m; n_full; punctured; h_rows = h_rows'; h_cols = h_cols'; gen_p } 541 + { n; k; m; n_full; h_rows = h_rows'; h_cols = h_cols'; gen_p } 541 542 542 543 (* --- Rate 1/2 k=1024 code (lazy to avoid startup cost) --- *) 543 544