Skip to content

Add instanceFormat/certificateFormat declarations to WEIGHTEDCUT - #500

Open
Trosper3 wants to merge 4 commits into
CSharpAPIfrom
backfill/weightedcut-format
Open

Add instanceFormat/certificateFormat declarations to WEIGHTEDCUT#500
Trosper3 wants to merge 4 commits into
CSharpAPIfrom
backfill/weightedcut-format

Conversation

@Trosper3

Copy link
Copy Markdown
Contributor

Summary

  • WEIGHTEDCUT never adopted the self-describing instance/certificate format pattern (Interfaces/ProblemInterface.cs) and had no dedicated test file.
  • Declares instanceFormat describing the ((N,E),K) weighted-graph grammar and certificateFormat describing the weighted-edge-set certificate, on WEIGHTEDCUT_Class.cs.
  • Adds a new WEIGHTEDCUT_Tests.cs covering the format declarations, including a check that the certificate example quoted in the format string ({({2,1},5)}) actually verifies true against defaultInstance via the real verifier.

Closes #455

Test plan

  • dotnet test redux-tests/redux-tests.csproj --filter "FullyQualifiedName~WEIGHTEDCUT" — 3/3 passing

WEIGHTEDCUT never adopted the self-describing instance/certificate
format pattern (Interfaces/ProblemInterface.cs) and had no dedicated
test file. Declares instanceFormat describing the ((N,E),K) weighted-
graph grammar and certificateFormat describing the weighted-edge-set
certificate, and adds a new WEIGHTEDCUT_Tests.cs covering the format
declarations.

Includes a check that the certificate example quoted in the format
string actually verifies true against defaultInstance.
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

Redux Build System — CI Report

dotnet · commit 3c18a54

Operation Status Summary Time
audit no known vulnerabilities 4.8s
format-check all files formatted 21.1s
lint 0 issues 31.2s
typecheck ⏭️ covered by lint (dotnet build)
unit-test 907 passed · coverage 70% (min 80%) 43.7s
build built local/redux:ci · 234MB 36.8s
integration-test ⏭️ no [integration] command
push ⏭️ not implemented

Overall: ❌ 4 passed · 1 failed · 3 skipped

…attern

Extracts the constructor's inline StringParser grammar into a named
InstanceGrammar const (now the single source of truth for both parsing
and instanceFormat), and adds CertificateGrammar/CertificateExample
consts to WeightedCutVerifier. instanceFormat/certificateFormat are now
interpolated from these plus _defaultInstance, instead of hand-duplicated
prose that could drift from the actual example.

Also merges in CSharpAPI to pick up the .editorconfig/dotnet-format
gate this branch predates, and reformats accordingly.
Superseded by the richer test file for this problem already open in PR #517 (instantiation + verifier theory + solver coverage vs. this PR's 3-test format smoke check). Keeping the instanceFormat/certificateFormat declaration changes; only dropping the file that would otherwise collide on merge.
wrigjl pushed a commit to wrigjl/Redux that referenced this pull request Sep 2, 2026
…nges

ProblemInstanceGenerators_Tests.cs and ProblemProvider_Endpoint_Tests.cs
were merged with Allman-style braces, violating the repo's
csharp_new_line_before_open_brace=none rule. This trips the
EnforceFormatting build gate on every PR whose CI checks out the
merge of PR-head + CSharpAPI, breaking PRs that never touched these
files (e.g. ReduxISU#484, ReduxISU#488-490, ReduxISU#495, ReduxISU#497, ReduxISU#500).
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.

Backfill instanceFormat/certificateFormat: NPC_WEIGHTEDCUT

1 participant