Skip to content
Merged

... #29

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [ "main", "master" ]
branches: ["main", "master"]
pull_request:

jobs:
Expand All @@ -29,4 +29,4 @@ jobs:
run: zig build

- name: Run tests
run: zig build test
run: zig build test
10 changes: 0 additions & 10 deletions .vscode/settings.json

This file was deleted.

78 changes: 41 additions & 37 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,31 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

// Create main executable
const exe = b.addExecutable(.{
.name = "mfs-engine",
.root_module = b.createModule(.{
.root_source_file = b.path("src/bin/main.zig"),
.target = target,
.optimize = optimize,
}),
});

exe.root_module.addImport("mfs", lib);
exe.root_module.addOptions("build_options", options);
addPlatformDependencies(exe, target.result.os.tag);
b.installArtifact(exe);

// Create run step for main executable
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}

const run_step = b.step("run", "Run the main executable");
run_step.dependOn(&run_cmd.step);

// Add memory manager tests
const memory_manager_tests = b.addTest(.{
.name = "memory-manager-tests",
Expand All @@ -107,6 +132,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
}),
});

memory_manager_tests.root_module.addImport("mfs", lib);
memory_manager_tests.root_module.addOptions("build_options", options);
addPlatformDependencies(memory_manager_tests, target.result.os.tag);
Expand All @@ -130,36 +156,10 @@ pub fn build(b: *std.Build) void {
test_step.dependOn(&memory_manager_tests.step);
test_step.dependOn(&vulkan_backend_tests.step);

// const examples = [_][]const u8{
// "vulkan_spinning_cube_simple",
// "vulkan_spinning_cube_real",
// "vulkan_rt_spinning_cube",
// };

// for (examples) |example| {
// const exe = b.addExecutable(.{
// .name = example,
// .root_module = b.createModule(.{
// .root_source_file = b.path(b.fmt("examples/{s}/main.zig", .{example})),
// .target = target,
// .optimize = optimize,
// }),
// });

// // Optionally link Vulkan system library for examples
// addOptionalLibrary(exe, "vulkan-1");

// // Link with main library
// exe.linkLibrary(lib);

// b.installArtifact(exe);

// const run_cmd = b.addRunArtifact(exe);
// run_cmd.step.dependOn(b.getInstallStep());

// const run_step = b.step(b.fmt("run-{s}", .{example}), b.fmt("Run the {s} example", .{example}));
// run_step.dependOn(&run_cmd.step);
// }
// Build tests, tools, and web target
buildTests(b, target, optimize, lib, options);
buildTools(b, target, optimize, lib, options);
buildWebTarget(b, target, optimize, lib, options);
}

fn addBuildOptions(options: *std.Build.Step.Options, target: std.Target) void {
Expand Down Expand Up @@ -254,12 +254,14 @@ fn buildTools(
for (tools) |tool| {
const exe = b.addExecutable(.{
.name = tool.name,
.root_source_file = b.path(tool.path),
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{
.root_source_file = b.path(tool.path),
.target = target,
.optimize = optimize,
}),
});
exe.root_module.addImport("mfs", mfs);
exe.addOptions("build_options", options);
exe.root_module.addOptions("build_options", options);
addPlatformDependencies(exe, target.result.os.tag);
b.installArtifact(exe);
}
Expand Down Expand Up @@ -287,9 +289,11 @@ fn buildWebTarget(

const web_exe = b.addExecutable(.{
.name = "mfs-web",
.root_source_file = b.path("src/main.zig"),
.target = web_target,
.optimize = .ReleaseSmall,
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = web_target,
.optimize = .ReleaseSmall,
}),
});

web_exe.root_module.addImport("mfs", mfs);
Expand Down
41 changes: 36 additions & 5 deletions build/build_spinning_cube.zig
Original file line number Diff line number Diff line change
@@ -1,17 +1,48 @@
const std = @import("std");

pub fn build(b: *std.Build) void {
// #region agent log
const log_path = ".cursor/debug.log";
if (std.fs.cwd().openFile(log_path, .{ .mode = .write_only })) |file| {
defer file.close();
_ = file.writeAll("{\"id\":\"log_build_entry\",\"location\":\"build/build_spinning_cube.zig:4\",\"message\":\"Build function entry\",\"data\":{\"hypothesisId\":\"A\"},\"sessionId\":\"debug-session\",\"runId\":\"run1\"}\n") catch {};
} else |_| {}
// #endregion

const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

// #region agent log
if (std.fs.cwd().openFile(log_path, .{ .mode = .write_only })) |file| {
defer file.close();
_ = file.writeAll("{\"id\":\"log_target_optimize\",\"location\":\"build/build_spinning_cube.zig:13\",\"message\":\"Target and optimize set\",\"data\":{\"hypothesisId\":\"A\"},\"sessionId\":\"debug-session\",\"runId\":\"run1\"}\n") catch {};
} else |_| {}
// #endregion

// Create the spinning cube executable
// #region agent log
if (std.fs.cwd().openFile(log_path, .{ .mode = .write_only })) |file| {
defer file.close();
_ = file.writeAll("{\"id\":\"log_before_addExecutable\",\"location\":\"build/build_spinning_cube.zig:20\",\"message\":\"Before addExecutable call\",\"data\":{\"source_file\":\"src/render/opengl_cube.zig\",\"hypothesisId\":\"B\"},\"sessionId\":\"debug-session\",\"runId\":\"run1\"}\n") catch {};
} else |_| {}
// #endregion

const spinning_cube = b.addExecutable(.{
.name = "spinning_cube",
.root_source_file = b.path("src/spinning_cube_app.zig"),
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{
.root_source_file = b.path("../src/render/opengl_cube.zig"),
.target = target,
.optimize = optimize,
}),
});

// #region agent log
if (std.fs.cwd().openFile(log_path, .{ .mode = .write_only })) |file| {
defer file.close();
_ = file.writeAll("{\"id\":\"log_after_addExecutable\",\"location\":\"build/build_spinning_cube.zig:30\",\"message\":\"After addExecutable call\",\"data\":{\"hypothesisId\":\"A\"},\"sessionId\":\"debug-session\",\"runId\":\"run1\"}\n") catch {};
} else |_| {}
// #endregion

// Add build options
const build_options = b.addOptions();
build_options.addOption(bool, "enable_tracy", false);
Expand All @@ -26,7 +57,7 @@ pub fn build(b: *std.Build) void {
build_options.addOption(bool, "is_desktop", true);
build_options.addOption([]const u8, "target_os", @tagName(target.result.os.tag));

spinning_cube.addOptions("build_options", build_options);
spinning_cube.root_module.addOptions("build_options", build_options);

// Link system libraries based on platform
switch (target.result.os.tag) {
Expand Down Expand Up @@ -71,7 +102,7 @@ pub fn build(b: *std.Build) void {
// Create test step
const spinning_cube_tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path("src/spinning_cube_app.zig"),
.root_source_file = b.path("../src/render/opengl_cube.zig"),
.target = target,
.optimize = optimize,
}),
Expand Down
27 changes: 23 additions & 4 deletions docs/AGENT_INTEGRATION_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## 🎯 **Integration Objectives**

### Primary Goals:
### Primary Goals

1. **Automate Development Workflow**
- Code generation and review
- Documentation updates
Expand All @@ -24,6 +25,7 @@
## 📋 **Integration Areas**

### 1. **Code Development**

- **Automated Code Generation**
- Generate boilerplate code for new features
- Create test cases automatically
Expand All @@ -37,6 +39,7 @@
- Security scanning

### 2. **Documentation**

- **Auto-Generated Docs**
- API documentation
- Code comments
Expand All @@ -49,6 +52,7 @@
- Best practices guides

### 3. **Testing & Quality**

- **Test Generation**
- Unit test creation
- Integration test setup
Expand All @@ -62,6 +66,7 @@
- Regression testing

### 4. **Build & Deployment**

- **CI/CD Integration**
- Automated builds
- Deployment scripts
Expand All @@ -71,6 +76,7 @@
## 🔧 **Technical Integration Points**

### 1. **GitHub Integration**

```yaml
# .github/workflows/agent-integration.yml
name: Agent Integration
Expand All @@ -93,6 +99,7 @@ jobs:
```

### 2. **Development Workflow**

```bash
# Agent-assisted development commands
./scripts/agent-code-review.sh
Expand All @@ -102,6 +109,7 @@ jobs:
```

### 3. **Configuration Files**

```json
// .cursor-agent-config.json
{
Expand All @@ -125,6 +133,7 @@ jobs:
## 🎯 **Specific MFS Engine Integration**

### 1. **Graphics Engine Assistance**

- **Shader Generation**
- GLSL shader templates
- WebGL optimization
Expand All @@ -136,6 +145,7 @@ jobs:
- Cross-platform compatibility

### 2. **WebAssembly Support**

- **WASM Optimization**
- Size optimization
- Performance tuning
Expand All @@ -147,6 +157,7 @@ jobs:
- HTML demo creation

### 3. **Documentation Enhancement**

- **Interactive Demos**
- Live code examples
- Performance benchmarks
Expand All @@ -160,17 +171,20 @@ jobs:
## 📊 **Expected Benefits**

### 1. **Development Speed**

- 40% faster code generation
- 60% reduced documentation time
- 50% faster testing setup

### 2. **Code Quality**

- Automated code review
- Style guide enforcement
- Performance optimization
- Security scanning

### 3. **Project Management**

- Automated issue tracking
- Feature development assistance
- Release automation
Expand All @@ -179,6 +193,7 @@ jobs:
## 🚀 **Implementation Steps**

### Phase 1: Setup & Configuration

1. **Agent Configuration**
- Set up agent with MFS Engine context
- Configure language-specific rules
Expand All @@ -190,6 +205,7 @@ jobs:
- Documentation automation

### Phase 2: Core Features

1. **Code Generation**
- Template-based code generation
- Test case creation
Expand All @@ -201,6 +217,7 @@ jobs:
- Security scanning

### Phase 3: Advanced Features

1. **Intelligent Assistance**
- Context-aware suggestions
- Performance optimization
Expand All @@ -221,14 +238,16 @@ jobs:

## 🔍 **Monitoring & Metrics**

### Key Metrics:
### Key Metrics

- **Code Quality**: Coverage, complexity, performance
- **Development Speed**: Time to feature completion
- **Documentation**: Completeness, accuracy, usefulness
- **User Experience**: Demo functionality, ease of use

### Success Criteria:
### Success Criteria

- ✅ Automated code review working
- ✅ Documentation auto-generation functional
- ✅ Performance improvements measurable
- ✅ Development workflow streamlined
- ✅ Development workflow streamlined
Loading