docs(examples): Add comprehensive Phase 3 constrained optimization ex…#65
Merged
noahgift merged 1 commit intoNov 23, 2025
Conversation
…amples Add constrained_optimization.rs demonstrating the three Phase 3 algorithms: - Projected Gradient Descent: Non-negative quadratic minimization - Augmented Lagrangian: Equality-constrained least squares - Interior Point: Linear programming, quadratic programming Includes 5 examples (~750 lines): 1. Non-negative quadratic with Projected GD (working perfectly) 2. Equality-constrained least squares with Augmented Lagrangian (excellent constraint satisfaction) 3. Linear programming with Interior Point 4. Quadratic programming with Interior Point 5. Method comparison on box-constrained problem Follows established pattern from batch_optimization.rs and convex_optimization.rs with detailed mathematical background, problem setup, solution validation, and performance analysis. Related: Phase 3 completion (commits 9-11)
noahgift
added a commit
that referenced
this pull request
Mar 7, 2026
Add `apr eval --task mbpp --data mbpp.jsonl` with full inference pipeline: - MbppProblem struct (text, code, task_id, test_list, test_setup_code) - run_mbpp() with same inference bridge as HumanEval (ALB-084) - run_mbpp_inference() with SafetensorsToAprConverter + forward_with_cache - Natural language prompt → completion → test_list assertion execution - max_new_tokens=512, timeout=10s (longer than HumanEval) - JSON output with per_problem_results, pass@k metrics 974 problems from Google MBPP dataset. Reuses sample_token(), truncate_at_function_boundary(), execute_python_test(), compute_pass_at_k(). Refs #65 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
noahgift
added a commit
that referenced
this pull request
Mar 7, 2026
Add `apr eval --task mbpp --data mbpp.jsonl` with full inference pipeline: - MbppProblem struct (text, code, task_id, test_list, test_setup_code) - run_mbpp() with same inference bridge as HumanEval (ALB-084) - run_mbpp_inference() with SafetensorsToAprConverter + forward_with_cache - Natural language prompt → completion → test_list assertion execution - max_new_tokens=512, timeout=10s (longer than HumanEval) - JSON output with per_problem_results, pass@k metrics 974 problems from Google MBPP dataset. Reuses sample_token(), truncate_at_function_boundary(), execute_python_test(), compute_pass_at_k(). Refs #65 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
noahgift
added a commit
that referenced
this pull request
Apr 19, 2026
v0.31.1 was yanked from crates.io because `cargo install aprender@0.31.1` panicked at aprender-mcp build.rs — `CARGO_MANIFEST_DIR/../../contracts/ apr-mcp-tool-schemas-v1.yaml` lives in the monorepo tree but NOT in the published tarball (outside the package root), so every external install hit a hard panic at build time. Three-layer defense so this class never recurs: 1. **In-crate contract copy** — contracts/apr-mcp-tool-schemas-v1.yaml copied into crates/aprender-mcp/contracts/ and Cargo.toml `include` lists `contracts/*.yaml`. build.rs reads `CARGO_MANIFEST_DIR/ contracts/…` (no `..` escape). Drift-guarded by new test `contract_copy_matches_workspace_root` which asserts byte-identity with the workspace-root copy in-tree, and skips when the workspace copy is absent (published-tarball mode). 2. **Static Poka-Yoke** — scripts/check_build_rs_paths.sh walks every git-tracked build.rs, flags any that join `".."` onto CARGO_MANIFEST_DIR AND `panic!`/`unwrap_or_else(…panic)` AND lack a `.exists()` guard or `ALLOW_ESCAPE` annotation. Reverting this fix locally makes the gate exit 1 with a remediation message. 3. **Wired into both gates** — `make tier3` runs the check pre-push, and `.github/workflows/ci.yml` `workspace-test` job runs it on every PR so a future build.rs path escape can't sneak back in. Yank command (already executed): cargo yank --version 0.31.1 <each of 68 crates> # all confirmed yanked Next step after this lands: cut v0.31.2, re-publish all 68 crates at 40s/crate pacing (crates.io 30-per-10min window), verify `cargo install aprender --version 0.31.2` actually installs this time. Refs: task #64 (yank), #65 (fix), #66 (prevention) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
6 tasks
noahgift
added a commit
that referenced
this pull request
Apr 19, 2026
…rd (#910) v0.31.1 was yanked from crates.io because `cargo install aprender@0.31.1` panicked at aprender-mcp build.rs — `CARGO_MANIFEST_DIR/../../contracts/ apr-mcp-tool-schemas-v1.yaml` lives in the monorepo tree but NOT in the published tarball (outside the package root), so every external install hit a hard panic at build time. Three-layer defense so this class never recurs: 1. **In-crate contract copy** — contracts/apr-mcp-tool-schemas-v1.yaml copied into crates/aprender-mcp/contracts/ and Cargo.toml `include` lists `contracts/*.yaml`. build.rs reads `CARGO_MANIFEST_DIR/ contracts/…` (no `..` escape). Drift-guarded by new test `contract_copy_matches_workspace_root` which asserts byte-identity with the workspace-root copy in-tree, and skips when the workspace copy is absent (published-tarball mode). 2. **Static Poka-Yoke** — scripts/check_build_rs_paths.sh walks every git-tracked build.rs, flags any that join `".."` onto CARGO_MANIFEST_DIR AND `panic!`/`unwrap_or_else(…panic)` AND lack a `.exists()` guard or `ALLOW_ESCAPE` annotation. Reverting this fix locally makes the gate exit 1 with a remediation message. 3. **Wired into both gates** — `make tier3` runs the check pre-push, and `.github/workflows/ci.yml` `workspace-test` job runs it on every PR so a future build.rs path escape can't sneak back in. Yank command (already executed): cargo yank --version 0.31.1 <each of 68 crates> # all confirmed yanked Next step after this lands: cut v0.31.2, re-publish all 68 crates at 40s/crate pacing (crates.io 30-per-10min window), verify `cargo install aprender --version 0.31.2` actually installs this time. Refs: task #64 (yank), #65 (fix), #66 (prevention) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…amples
Add constrained_optimization.rs demonstrating the three Phase 3 algorithms:
Includes 5 examples (~750 lines):
Follows established pattern from batch_optimization.rs and convex_optimization.rs with detailed mathematical background, problem setup, solution validation, and performance analysis.
Related: Phase 3 completion (commits 9-11)