Skip to content

Clean up generated code#7

Merged
RyanMarcus merged 1 commit into
learnedsystems:masterfrom
r-barnes:richard/code_gen_fixes
May 27, 2026
Merged

Clean up generated code#7
RyanMarcus merged 1 commit into
learnedsystems:masterfrom
r-barnes:richard/code_gen_fixes

Conversation

@r-barnes
Copy link
Copy Markdown
Contributor

Add #pragma once header guards to C++ output - this is the primary syntactic change as it allows for safe inclusion of the generated headers in multiple files.
Clean up generated code by adding some spacing and sorting includes - makes generated code (slightly) easier to read.
Update contributors.

A side-effect of the PR is to eliminate trailing whitespace in the touched files.

Clean up generated code by adding some spacing and sorting includes
Update contributors
@RyanMarcus RyanMarcus merged commit 6f03e69 into learnedsystems:master May 27, 2026
nh13 referenced this pull request in fg-labs/prmi May 28, 2026
…src/upstream/

Establishes the Cargo workspace shape that the v0.1 stack will build on:

* Root `Cargo.toml` declares `prmi` + `prmi-sys` members and a shared
  `workspace.dependencies` block.
* `prmi/Cargo.toml` ships the upstream-dependency set (log, byteorder,
  rayon, plus the rmi_lib-inherited indicatif/json/bytesize/superslice/
  tabular crates that Marcus's source references).
* `prmi/src/lib.rs` is a stub declaring `pub mod upstream;`. Fulcrum-
  authored modules (encoding, fasta, sa, sidecar, train, index, cli)
  land in subsequent PRs.
* `prmi-sys/Cargo.toml` + `prmi-sys/src/lib.rs` are placeholders so the
  workspace member set is stable from PR #1 onward; the actual FFI
  surface lands in PR #7 (`feat/v0.1-prmi-sys`).

Marcus's primitives move from the original repo layout
(`src/`, `rmi_lib/`, `tests/`) into `prmi/src/upstream/`:

* `prmi/src/upstream/models/` — LinearModel, LinearSplineModel,
  LogLinearModel, RobustLinearModel, RMITrainingData, Model trait,
  ModelInput, ModelParam, TrainingKey, stdlib/utils helpers. Fulcrum
  extensions added (`weighted_slr`, `LinearModel::new_weighted`,
  `LinearSplineModel::new_weighted`) for the upcoming priors PR.
* `prmi/src/upstream/train/` — `lower_bound_correction.rs` (with the
  Fulcrum Option-returning accessors `next_real`/`prev_real`/
  `next_index_real`/`prev_index_real` plus the `*_is_real` bools that
  disambiguate sentinel entries), `two_layer.rs` (kept verbatim,
  unused by the Fulcrum trainer but preserved for upstream parity),
  `mod.rs`.
* `prmi/src/upstream/mod.rs` re-exports the model primitives and
  marks the module `#[allow(clippy::all, unused_*, dead_code)]`
  so inherited code does not pollute the workspace lint surface.

Per-file copyright headers (`// Copyright Ryan Marcus 2020` plus
`// Modified by Fulcrum Genomics 2026` where applicable) identify
inherited vs new code. `LICENSE-FORK-NOTICE.md` documents the lineage.

Pruned from Marcus's original layout (replaced by prmi v0.1 design):

* `src/main.rs`, `src/load.rs` — the standalone `rmi` optimizer binary.
* `rmi_lib/src/{cache_fix, codegen, optimizer}.rs` — codegen + tuning
  machinery for the upstream binary, not used by the prmi trainer.
* `rmi_lib/src/models/{balanced_radix, cubic_spline, histogram, normal,
  radix}.rs` — RMI model variants outside prmi's v0.1 scope.
* `rmi_lib/src/train/multi_layer.rs` — multi-layer trainer; prmi's
  cleanroom trainer (PR #4a) is single-L1-L2.
* `tests/` — Marcus's RMI binary CLI tests; prmi tests in PR #2+.
* `.drone.yml`, `COPYING`, `example_param_grid.json` — Marcus's CI
  config (replaced by `.github/workflows/ci.yml` in PR #8) and
  optimizer-specific artefacts.

Workspace builds clean (`cargo build --workspace`) and the 3 unit
tests inherited from upstream models pass.
nh13 referenced this pull request in fg-labs/prmi May 28, 2026
…src/upstream/ (#2)

Establishes the Cargo workspace shape that the v0.1 stack will build on:

* Root `Cargo.toml` declares `prmi` + `prmi-sys` members and a shared
  `workspace.dependencies` block.
* `prmi/Cargo.toml` ships the upstream-dependency set (log, byteorder,
  rayon, plus the rmi_lib-inherited indicatif/json/bytesize/superslice/
  tabular crates that Marcus's source references).
* `prmi/src/lib.rs` is a stub declaring `pub mod upstream;`. Fulcrum-
  authored modules (encoding, fasta, sa, sidecar, train, index, cli)
  land in subsequent PRs.
* `prmi-sys/Cargo.toml` + `prmi-sys/src/lib.rs` are placeholders so the
  workspace member set is stable from PR #1 onward; the actual FFI
  surface lands in PR #7 (`feat/v0.1-prmi-sys`).

Marcus's primitives move from the original repo layout
(`src/`, `rmi_lib/`, `tests/`) into `prmi/src/upstream/`:

* `prmi/src/upstream/models/` — LinearModel, LinearSplineModel,
  LogLinearModel, RobustLinearModel, RMITrainingData, Model trait,
  ModelInput, ModelParam, TrainingKey, stdlib/utils helpers. Fulcrum
  extensions added (`weighted_slr`, `LinearModel::new_weighted`,
  `LinearSplineModel::new_weighted`) for the upcoming priors PR.
* `prmi/src/upstream/train/` — `lower_bound_correction.rs` (with the
  Fulcrum Option-returning accessors `next_real`/`prev_real`/
  `next_index_real`/`prev_index_real` plus the `*_is_real` bools that
  disambiguate sentinel entries), `two_layer.rs` (kept verbatim,
  unused by the Fulcrum trainer but preserved for upstream parity),
  `mod.rs`.
* `prmi/src/upstream/mod.rs` re-exports the model primitives and
  marks the module `#[allow(clippy::all, unused_*, dead_code)]`
  so inherited code does not pollute the workspace lint surface.

Per-file copyright headers (`// Copyright Ryan Marcus 2020` plus
`// Modified by Fulcrum Genomics 2026` where applicable) identify
inherited vs new code. `LICENSE-FORK-NOTICE.md` documents the lineage.

Pruned from Marcus's original layout (replaced by prmi v0.1 design):

* `src/main.rs`, `src/load.rs` — the standalone `rmi` optimizer binary.
* `rmi_lib/src/{cache_fix, codegen, optimizer}.rs` — codegen + tuning
  machinery for the upstream binary, not used by the prmi trainer.
* `rmi_lib/src/models/{balanced_radix, cubic_spline, histogram, normal,
  radix}.rs` — RMI model variants outside prmi's v0.1 scope.
* `rmi_lib/src/train/multi_layer.rs` — multi-layer trainer; prmi's
  cleanroom trainer (PR #4a) is single-L1-L2.
* `tests/` — Marcus's RMI binary CLI tests; prmi tests in PR #2+.
* `.drone.yml`, `COPYING`, `example_param_grid.json` — Marcus's CI
  config (replaced by `.github/workflows/ci.yml` in PR #8) and
  optimizer-specific artefacts.

Workspace builds clean (`cargo build --workspace`) and the 3 unit
tests inherited from upstream models pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants