Skip to content

fix: sofai graph coloring example — broken model and incorrect problem #806#807

Merged
planetf1 merged 1 commit intogenerative-computing:mainfrom
planetf1:fix/sofai-graph-coloring-806
Apr 10, 2026
Merged

fix: sofai graph coloring example — broken model and incorrect problem #806#807
planetf1 merged 1 commit intogenerative-computing:mainfrom
planetf1:fix/sofai-graph-coloring-806

Conversation

@planetf1
Copy link
Copy Markdown
Contributor

@planetf1 planetf1 commented Apr 9, 2026

Fix sofai_graph_coloring example — broken model and incorrect problem (#806)

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

The sofai_graph_coloring.py example had three problems:

  1. Model crash: phi:2.7b triggers an assertion failure in llama-sampling.cpp
    with current Ollama versions (incompatible GGUF quant). Replaced with granite4:micro
    (S1) and granite4:latest (S2), both already used by other tests.

  2. Inconsistent problem definition: The graph dict defined a path (A—B—C) but
    graph_description described a triangle (A—B—C—A). With only 2 colors, the prompted
    triangle is unsolvable — the LLM correctly introduces a third color, which the
    validator rejects.

  3. SOFAI loop never exercised: Even with a consistent graph, K₃ + 3 colors is
    trivially solved first try, so the retry loop and S1→S2 escalation were never
    demonstrated.

Fix: Use an odd 5-cycle (A—B—C—D—E—A) with 3 colors. This is non-trivial enough
that granite4:micro consistently fails (wraps JSON in markdown, gets adjacency wrong),
properly exercising the SOFAI retry loop and S1→S2 escalation. Deterministic with
seed=42, temperature=0.1. Verified passing 3 times standalone.

Also removed phi:2.7b and pielee/qwen3-4b-thinking-2507_q8:latest from model lists
in CONTRIBUTING.md and sofai README — these were only used by this example.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

@github-actions github-actions Bot added the bug Something isn't working label Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

The PR description has been updated. Please fill out the template for your PR to be reviewed.

generative-computing#806)

- Replace phi:2.7b (crashes with GGUF sampler assertion) with granite4:micro
- Replace qwen3-4b-thinking with granite4:latest (already used elsewhere)
- Fix graph/description mismatch: graph dict was a path but description
  claimed a triangle, making the problem unsolvable with 2 colors
- Use odd 5-cycle (A-B-C-D-E-A) with 3 colors — non-trivial enough that
  granite4:micro consistently fails, properly exercising the SOFAI retry
  loop and S1→S2 escalation

Closes generative-computing#806
@planetf1 planetf1 force-pushed the fix/sofai-graph-coloring-806 branch from 2db711b to 1cc4b8c Compare April 9, 2026 22:15
@planetf1 planetf1 requested a review from jakelorocco April 9, 2026 22:15
@planetf1 planetf1 marked this pull request as ready for review April 9, 2026 22:16
@planetf1 planetf1 requested a review from a team as a code owner April 9, 2026 22:16
@planetf1 planetf1 requested a review from psschwei April 9, 2026 22:16
@planetf1
Copy link
Copy Markdown
Contributor Author

planetf1 commented Apr 9, 2026

Original example was written by @keerthi166 and then documented by @akihikokuroda - any thoughts on the modification of the test welcome :-)

@planetf1 planetf1 enabled auto-merge April 10, 2026 06:42
Copy link
Copy Markdown
Contributor

@jakelorocco jakelorocco left a comment

Choose a reason for hiding this comment

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

seems like a reasonable improvement to me

@planetf1 planetf1 added this pull request to the merge queue Apr 10, 2026
Merged via the queue into generative-computing:main with commit 8860f64 Apr 10, 2026
8 checks passed
@planetf1 planetf1 deleted the fix/sofai-graph-coloring-806 branch April 10, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: sofai_graph_coloring example fails — Ollama model runner crash with phi:2.7b

2 participants