Skip to content

fix: structural issue batch — bounded reads, oracle coherence, protocol comparison, vLLM percentiles - #293

Merged
morluto merged 21 commits into
mainfrom
fix/structural-issues-batch
Aug 11, 2026
Merged

fix: structural issue batch — bounded reads, oracle coherence, protocol comparison, vLLM percentiles#293
morluto merged 21 commits into
mainfrom
fix/structural-issues-batch

Conversation

@morluto

@morluto morluto commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

This PR addresses multiple critical and high-severity open issues in the flameox codebase:

Fixed issues

Commands run

uv run pytest tests/ -x -q
uv run ruff check src tests
uv run mypy src tests

All 924 tests pass. Ruff and mypy clean.

Continue this on Linzumi

Replace unbounded stream.readline() in _excerpt() with a bounded
chunk-based discard loop (_discard_rest_of_line). Peak memory is now
bounded by _DISCARD_CHUNK_SIZE (4 KiB) instead of the full physical
line length, which could be gigabytes for newline-free artifact lines.

Closes #291
Add a cross-field model_validator to OracleReceiptV1 that rejects
receipts where the categorical status contradicts the quantitative
evidence. A status='pass' receipt with absolute_error exceeding
tolerance.absolute is now rejected at validation time, and a
status='fail' receipt with error within tolerance is rejected too.
Receipts without quantitative evidence are accepted with any status.

Closes #290
…iter-joined strings

Replace _normalize()'s unescaped delimiter encoding for dicts
('k1=v1,k2=v2') with canonical JSON serialization (sorted keys). The
old encoding could make distinct kv_transfer_config dicts produce
identical normalized strings when keys or values contained commas or
equals signs, causing incompatible server configurations to be
declared comparable.

Closes #288
…known/auto-detected as none

Stop rewriting plan.quantization=None as 'none' when constructing
ModelIdentity. An omitted quantization field means the provider will
auto-detect (e.g. vLLM reads the model's quantization_config), which
is not the same as explicitly unquantized. Preserving None lets the
protocol comparator correctly distinguish unknown/auto-detected from
explicitly-none.

Closes #289
…utable

Add twine>=6.1 to the dev dependency group so it is lockfile-bound
instead of network-resolved at release time. Replace the unpinned
'uvx --from twine twine check' with 'uv run twine check' so the
validation tool is installed from the committed uv.lock, not
dynamically resolved.

Also fix typing: add TextIO annotation to _discard_rest_of_line and
use OracleStatus enum in oracle receipt tests.

Closes #292
…ggregate statistics

- Use exact percentile rank in metric name instead of int() truncation
  (p99.1 and p99.9 both produced 'p99' before)
- Add std_* fields to the non-negative latency validator
- Reject infinity for actual_duration and time_scale
- Reject missing 'duration' field instead of defaulting to 0.0

Closes #287
The release.yml change requires workflow scope to push. Keep the
pyproject.toml/uv.lock twine pinning and the typing fixes; apply the
workflow change separately when authorized.
@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

…instead of Python equality

Add scalar_identity(), scalar_equal(), scalar_contains(), scalar_subset()
and scalar_identity_set() helpers that distinguish bool/int/float/str
by exact JSON type. Replace all Python equality (==, in, set operations)
in experiment factor validation with these type-safe helpers.

Closes #258

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17e945a13c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/flameox/domain/models.py Outdated
Comment thread src/flameox/adapters/inference.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 529aefb037

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/flameox/application/experiments.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d3ef1b709

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/flameox/application/faults.py
Comment thread pyproject.toml
Comment thread src/flameox/application/inference.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd57b18e80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/flameox/application/experiments.py Outdated
Comment thread src/flameox/application/experiments.py Outdated
Comment thread src/flameox/application/workloads.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ebc9922ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/flameox/analysis/recipe_scaling.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4762de6777

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/flameox/domain/models.py Outdated
@morluto
morluto merged commit c121b64 into main Aug 11, 2026
26 checks passed
@morluto
morluto deleted the fix/structural-issues-batch branch August 11, 2026 20:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ee72e6f68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

variant_parameter=variant_parameter,
variants=variants,
baseline_variant=(
self._factor_label(config.baseline_value)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve typed identity in baseline selection

When a treatment factor contains type-distinct values with the same display label, such as integer 1 and string "1", converting baseline_value through _factor_label() collapses both to "1". The plan then cannot distinguish the declared baseline: trials and run-set selections are grouped under the same label, causing automatic comparison to be skipped or outcome failures to be attributed to the wrong side. Store the typed scalar identity rather than only its display label.

AGENTS.md reference: AGENTS.md:L46-L49

Useful? React with 👍 / 👎.

line,
metric,
unit,
_input_kind,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep input kinds separate in hotspot correlations

When a scaling experiment mixes integer and floating inputs, _input_kind is discarded here before computing Spearman correlations, so type-distinct workload points such as integer 1 and floating 1.0 are pooled onto the same numeric axis. Although this revision excludes mixed-kind fits, it can still report misleading hotspot coefficients and p-values from the same incompatible population; exclude or stratify mixed-kind hotspot correlations as well.

AGENTS.md reference: AGENTS.md:L46-L49

Useful? React with 👍 / 👎.

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.

1 participant