Skip to content

Initial Floodfill Code#5

Open
AFE123xr wants to merge 1 commit intorelease/stm32mazefrom
afe123x/floodfill
Open

Initial Floodfill Code#5
AFE123xr wants to merge 1 commit intorelease/stm32mazefrom
afe123x/floodfill

Conversation

@AFE123xr
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

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

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: cfaf85c39a

ℹ️ 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".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a simulator-facing API layer (Unix domain socket), adds shared maze context/types plus a queue utility, and refactors the floodfill entrypoints to operate on an explicit mazectx state. It also updates the build to produce both the solver and a socket relay tool.

Changes:

  • Add Unix-socket based simulator API client (api.c/.h) and a socket_reader relay binary.
  • Introduce mazectx shared types (maze_common.h) and a fixed-size queue (queue.c/.h) used by a new reflood() weight propagation helper.
  • Update build/CI to compile the new sources and produce two binaries.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
socket_reader.c Adds a Unix-domain-socket relay that forwards stdin/stdout between the simulator protocol and the solver.
api.h Declares the simulator API surface used by solver code.
api.c Implements the simulator API client over a Unix domain socket.
maze_common.h Defines shared maze types (direction_t, position_t, mazectx).
queue.h Declares a small coordinate queue used by reflood/BFS.
queue.c Implements the queue used for reflood/BFS traversal.
floodfill.h Changes floodfill API to accept a mazectx* and adds helper declarations.
floodfill.c Adds goal-setting, weight reset, maze printing, and a reflood() BFS scaffold.
main.c Refactors main to build a mazectx, set goals, reflood, print, and call floodfill with context.
astar.h Includes maze_common.h (presumably for future context-aware A*).
Makefile Builds mazealgo + socket_reader, adds sanitizer flags, and a run target.
.github/workflows/maze-build.yml Removes the “Run maze solver” step and keeps debug/release builds.
output.txt Adds a large captured debug output log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch 2 times, most recently from a9d0947 to 18a16c4 Compare March 28, 2026 06:38
@AFE123xr AFE123xr requested a review from Copilot March 28, 2026 06:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch 6 times, most recently from db15628 to 3bfdb4e Compare March 28, 2026 07:27
@AFE123xr AFE123xr changed the title Afe123x/floodfill Initial Floodfill Code Mar 28, 2026
AFE123xr added a commit that referenced this pull request Mar 28, 2026
…ket utility for mms (#5)

- Implemented Floodfill Algorithm.
	- can set goal using the setgoal function.
	- implemented mechanism, allowing for diagonals for sections that are already known.
- created maze_common.h, providing common structures for the AStar implementation (albeit, it's obsolete now.
- created queue.c and queue.h as supporting data structure for floodfill.
- Created mms adapter, socket_reader.c, which will forward message from maze algorithm to mms.
- Updated Makefile for compilation.
	- added various variables, like SIM, DEBUG, BUILD_TYPE, etc.
- removed run test from github workflow .yaml file
	- there's no reason to include this test
@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch from 3bfdb4e to b01809b Compare March 28, 2026 13:10
@AFE123xr AFE123xr requested a review from Copilot March 28, 2026 13:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

AFE123xr added a commit that referenced this pull request Mar 28, 2026
…ket utility for mms (#5)

- Implemented Floodfill Algorithm.
	- can set goal using the setgoal function.
	- implemented mechanism, allowing for diagonals for sections that are already known.
- created maze_common.h, providing common structures for the AStar implementation (albeit, it's obsolete now.
- created queue.c and queue.h as supporting data structure for floodfill.
- Created mms adapter, socket_reader.c, which will forward message from maze algorithm to mms.
- Updated Makefile for compilation.
	- added various variables, like SIM, DEBUG, BUILD_TYPE, etc.
- removed run test from github workflow .yaml file
	- there's no reason to include this test
@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch from 5f4d92a to 93d6cb0 Compare March 28, 2026 14:00
AFE123xr added a commit that referenced this pull request Mar 28, 2026
…ket utility for mms (#5)

- Implemented Floodfill Algorithm.
	- can set goal using the setgoal function.
	- implemented mechanism, allowing for diagonals for sections that are already known.
- created maze_common.h, providing common structures for the AStar implementation (albeit, it's obsolete now.
- created queue.c and queue.h as supporting data structure for floodfill.
- Created mms adapter, socket_reader.c, which will forward message from maze algorithm to mms.
- Updated Makefile for compilation.
	- added various variables, like SIM, DEBUG, BUILD_TYPE, etc.
- removed run test from github workflow .yaml file
	- there's no reason to include this test
@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch from 93d6cb0 to 9e45f15 Compare March 28, 2026 14:07
AFE123xr added a commit that referenced this pull request Mar 28, 2026
…ket utility for mms (#5)

- Implemented Floodfill Algorithm.
	- can set goal using the setgoal function.
	- implemented mechanism, allowing for diagonals for sections that are already known.
- created maze_common.h, providing common structures for the AStar implementation (albeit, it's obsolete now.
- created queue.c and queue.h as supporting data structure for floodfill.
- Created mms adapter, socket_reader.c, which will forward message from maze algorithm to mms.
- Updated Makefile for compilation.
	- added various variables, like SIM, DEBUG, BUILD_TYPE, etc.
- removed run test from github workflow .yaml file
	- there's no reason to include this test
@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch from 9e45f15 to ec191a0 Compare March 28, 2026 14:09
@AFE123xr AFE123xr requested a review from Copilot March 28, 2026 14:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

.github/workflows/maze-build.yml:26

  • The workflow's "release" build still calls make CFLAGS+=' -O2', but the Makefile now uses BUILD_TYPE/SANITIZE to control optimization and sanitizers. As written, this job will still run with BUILD_TYPE=debug defaults (e.g., -Og/-g) and SANITIZE=1 unless overridden, so it's not a true release build. Update the workflow to invoke something like make BUILD_TYPE=release SANITIZE=0 (and pass SIM/DEBUG as needed).
      - name: Build project (debug)
        run: make

      - name: Build project (release / -O2)
        run: |
          make clean
          make CFLAGS+=' -O2'


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

AFE123xr added a commit that referenced this pull request Mar 28, 2026
…ket utility for mms (#5)

- Implemented Floodfill Algorithm.
	- can set goal using the setgoal function.
	- implemented mechanism, allowing for diagonals for sections that are already known.
- created maze_common.h, providing common structures for the AStar implementation (albeit, it's obsolete now.
- created queue.c and queue.h as supporting data structure for floodfill.
- Created mms adapter, socket_reader.c, which will forward message from maze algorithm to mms.
- Updated Makefile for compilation.
	- added various variables, like SIM, DEBUG, BUILD_TYPE, etc.
- removed run test from github workflow .yaml file
	- there's no reason to include this test
@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch from ec191a0 to d9427c7 Compare March 28, 2026 20:37
@AFE123xr AFE123xr requested a review from Copilot March 28, 2026 20:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

.github/workflows/maze-build.yml:26

  • The workflow’s “release” build still runs make CFLAGS+=' -O2', but the Makefile now expects BUILD_TYPE=release to switch from debug (-Og -g) to -O2. As written, CI will likely build with debug flags plus an extra -O2, which is not the intended configuration. Update this step to make clean && make BUILD_TYPE=release (and set SANITIZE/SIM as desired).
      - name: Build project (release / -O2)
        run: |
          make clean
          make CFLAGS+=' -O2'


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

AFE123xr added a commit that referenced this pull request Mar 28, 2026
…ket utility for mms (#5)

- Implemented Floodfill Algorithm.
	- can set goal using the setgoal function.
	- implemented mechanism, allowing for diagonals for sections that are already known.
- created maze_common.h, providing common structures for the AStar implementation (albeit, it's obsolete now.
- created queue.c and queue.h as supporting data structure for floodfill.
- Created mms adapter, socket_reader.c, which will forward message from maze algorithm to mms.
- Updated Makefile for compilation.
	- added various variables, like SIM, DEBUG, BUILD_TYPE, etc.
- removed run test from github workflow .yaml file
	- there's no reason to include this test
- created custom debug console, enabled with the DEBUG flag.
	- you can step through the maze algorithm step by step.
@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch from d9427c7 to 0eb8152 Compare March 28, 2026 20:44
- Updated README.md to include instructions
- created floodfill.c template
- created queue.c data structure
- created socket_reader.c as an adapter between maze program and mms
- created api.c, which provides interface for mms.
- Updated Makefile to include various flags (specified in docs)

cleaned

sontehu
@AFE123xr AFE123xr force-pushed the afe123x/floodfill branch from 05feb4e to 9fc5f69 Compare April 2, 2026 14:38
@AFE123xr AFE123xr requested a review from ridxm April 2, 2026 14:40
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.

3 participants