Commit Graph
202 Commits
Author SHA1 Message Date
cozis b7fc855a80 Move miscellaneous files to the misc folder 2025-11-17 13:06:51 +01:00
cozis cd865a5cdf Simplify Features bullet points to make them easier to read 2025-11-17 13:04:56 +01:00
cozis ec159a2c6a Minor reorganization of test in the README.md 2025-11-17 13:03:01 +01:00
cozis 04a706dad9 Add code snippet to README.md 2025-11-17 13:01:30 +01:00
cozis bc0a95a9a5 Turn TODO.txt in a list of checkboxes 2025-11-17 12:54:06 +01:00
cozis 4accabc4e2 Add Features paragraph to README.md 2025-11-17 12:48:52 +01:00
cozis 09f1ed4b3e Reorganize types in ToastyFS.h by placing them near function interfaces that reference them 2025-11-17 11:50:22 +01:00
cozis 3fc1e12623 Modify Makefile clean rule to remove compilation artifacts by their extension (.exe, .out, ...), not their full name 2025-11-17 11:46:23 +01:00
cozis 46db334a2e Resolve compilation errors and implement blocking API 2025-11-17 11:32:09 +01:00
cozis ee05547981 Fix compilation errors 2025-11-16 16:16:54 +01:00
cozis c6cac0155e Change client.c to match the new ToastyFS.h API 2025-11-16 16:07:03 +01:00
cozis b591408cc9 Fix some build errors 2025-11-16 13:01:08 +01:00
cozis f7dc52ae8f Add example of the blocking API 2025-11-16 12:21:31 +01:00
cozis 58d2d7def3 Polish API in ToastyFS.h 2025-11-16 11:59:58 +01:00
cozis 914419df6d Add timeout logic to toastyfs_wait 2025-11-16 11:59:39 +01:00
cozis 91a2395448 Add README 2025-11-16 02:21:37 +01:00
cozis e1cdc28d4d Rename project to ToastyFS 2025-11-16 02:10:59 +01:00
cozis a4a37b7a36 Minor fixes 2025-11-16 01:18:05 +01:00
cozis 7af1bc27b5 Fix value of CHUNK_SERVER_RECONNECT_TIME by expressing it in seconds, also change it to a runtime-modifiable value 2025-11-15 12:10:26 +01:00
cozis 11054cae86 Add new chunk hashes to the cs_add_list when creating or updating them in the chunk server 2025-11-15 10:55:11 +01:00
cozis a366b46398 Bug fixes 2025-11-15 10:38:45 +01:00
cozis a11740ab41 Fix uninitialized BinaryReader struct when parsing auth response message 2025-11-14 21:14:33 +01:00
cozis bbae5fdb7f Fix compilation errors 2025-11-14 21:06:38 +01:00
cozis 3df1745d69 Add comments 2025-11-14 12:07:32 +01:00
cozis 2bbe1ac0e8 Clean up download logic for missing/lost chunks 2025-11-14 11:56:29 +01:00
Francesco CozzutoandGitHub 787807031b Merge pull request #11 from cozis/improve-chunk-management-policy
Improve chunk management policy
2025-11-14 01:17:57 +01:00
cozis 9a944feb01 Rewrote simulation scheduler and fixed some bugs 2025-11-14 01:16:48 +01:00
cozis 3a2173c154 Minor bug fixes 2025-11-13 23:37:42 +01:00
cozis 3048f3d66b Bug fixes 2025-11-13 23:02:25 +01:00
Francesco CozzutoandGitHub de3391c34a Merge pull request #10 from cozis/claude/measure-branch-coverage-0168rdcTg6viLER3ufRwoAye
Measure branch coverage of the simulation testing
2025-11-13 21:53:39 +01:00
Claude d4ecf6db17 Replace custom HTML generation with lcov/genhtml
Use the standard lcov tools instead of custom HTML generation.

Changes:
- Completely rewrite generate_coverage_html.sh to use lcov
- Install lcov if not available
- Use lcov to capture coverage data from .gcda files
- Use genhtml to create HTML reports with branch coverage
- Add scripts/README.md with usage instructions

Benefits:
- Professional HTML reports with standard lcov styling
- Better branch coverage visualization
- Sortable tables by line/function/branch coverage
- Source code view with execution counts
- Much simpler script (30 lines vs 200+ lines)

The reports now show:
- 32.1% branch coverage (781/2431 branches)
- 43.5% line coverage
- 61.3% function coverage
2025-11-13 20:41:28 +00:00
Claude abaa12c5b3 Remove all CSS styling from HTML reports, use browser defaults
Remove all custom styling and CSS to use only plain HTML with
browser default rendering.

Changes:
- Remove all <style> tags and CSS
- Remove CSS classes from generated HTML
- Simplify source code display to plain text format
- Use simple line number: execution count: source code format
- Browser will render with its own default styles

The reports are now pure HTML with no styling at all.
2025-11-13 20:26:20 +00:00
Claude b6b926a659 Simplify HTML coverage report styling to use minimal default styles
Remove fancy styling (rounded corners, shadows, progress bars, colors)
and use simple, clean HTML with basic tables and minimal CSS.

Changes:
- Use simple sans-serif font instead of Segoe UI
- Remove container divs, shadows, and rounded corners
- Replace progress bars with plain percentage text
- Simplify color scheme (light green/red for branch coverage)
- Remove emoji and decorative elements
- Clean up table styling to basic borders

The report is now much cleaner and follows standard HTML conventions.
2025-11-13 20:24:04 +00:00
Claude 4c0b3429f0 Add .gitattributes to enforce LF line endings for shell scripts
This fixes issues when running scripts in WSL where CRLF line endings
cause 'No such file or directory' errors. Also add a fix_line_endings.sh
script for users who already have the wrong line endings.
2025-11-13 20:07:57 +00:00
Claude d288b2896f Move coverage scripts to scripts/ directory and add Makefile targets
Reorganize coverage tooling for better project structure and easier usage.

Changes:
- Move measure_coverage.sh and generate_coverage_html.sh to scripts/
- Add Makefile targets:
  - make coverage-report: Generate text coverage summary (5s simulation)
  - make coverage-html: Generate HTML coverage report (5s simulation)
- Update measure_coverage.sh to find generate_coverage_html.sh using relative path

Usage:
  make coverage-report    # Quick text summary
  make coverage-html      # Full HTML report with branch details

The HTML report provides interactive visualization of which branches
were taken during simulation execution, with color-coded source views.
2025-11-13 19:58:14 +00:00
Claude b465d5282e Add HTML coverage reports with branch-level detail
Enhance the branch coverage measurement tool with HTML report generation
that shows exactly which branches were taken during simulation execution.

Changes:
- Add generate_coverage_html.sh script to create interactive HTML reports
- Update measure_coverage.sh with --html flag to generate reports
- Add *.gcov, *.gcda, *.gcno to .gitignore
- HTML reports show:
  - Overall coverage summary with visual progress bars
  - Per-file coverage breakdown with clickable links
  - Source code view with color-coded branch coverage
  - Green highlight: branches taken
  - Red highlight: branches not taken
  - Branch execution counts and percentages

Usage:
  ./measure_coverage.sh [duration] --html

The HTML report is generated in coverage_report/index.html and can be
viewed in any web browser. Each source file links to a detailed view
showing which specific branches were executed.
2025-11-13 19:55:08 +00:00
Claude 4b97b176bd Add branch coverage measurement for random simulation
This commit adds tooling to measure how many branches the random simulation
reaches during execution, which helps understand code coverage and identify
untested code paths.

Changes:
- Add coverage build target to Makefile with --coverage flags
- Create measure_coverage.sh script to build, run, and report branch coverage
- Add signal handlers (SIGINT/SIGTERM) to main_test.c for clean shutdown
- Update clean target to remove coverage files (*.gcda, *.gcno)

The script runs the simulation for a specified duration (default 5 seconds),
then uses gcov to analyze which branches were executed. In a 3-second run,
the simulation reaches approximately 32% of all branches (781/2431).

Usage:
  ./measure_coverage.sh [duration_in_seconds]

Example output shows per-file and total branch coverage statistics.
2025-11-13 19:35:06 +00:00
cozis 7b01ac6384 Fix compilation errors 2025-11-13 20:21:26 +01:00
cozis cdce267768 Update DESIGN.txt and code accordingly 2025-11-13 17:27:00 +01:00
cozis facd220c59 Fix corner case in DESIGN.txt 2025-11-13 12:18:34 +01:00
cozis 4ec47e66b4 Clean up chunk management section of DESIGN.txt 2025-11-13 12:09:29 +01:00
Claude 14cd2f1ac6 Fix compilation issues
Fixed compilation errors:
- Added <dirent.h> include to file_system.h for DIR type on Linux
- Replaced xxx placeholder in chunk_server.c with actual chunks_dir path
  using state->store.path
2025-11-13 00:47:56 +00:00
Claude 6c2ea4bce9 Fix DirectoryScanner implementation bugs
Fixed several bugs in the DirectoryScanner implementation:

Windows fixes:
- Fixed snprintf call missing buffer size parameter
- Fixed FindFirstFileA to use pattern (with wildcard) instead of path
- Changed sys_GetLastError() to GetLastError()
- Added scanner->first = false after using first result
- Removed TODO comment from cFileName usage (it's the correct field)

Linux fixes:
- Fixed typo: sys_reddir → sys_readdir
- Added missing 'done' field to DirectoryScanner struct
- Initialize scanner->done = false on successful opendir
- Fixed return value when scanner->done (should return 1, not -1)
2025-11-13 00:45:51 +00:00
Claude c903567309 Add mocks for file search system calls (Windows and Linux)
Added mock implementations for file/directory search operations to
support both Windows and Linux in the simulation environment.

Windows mocks:
- FindFirstFileA: Wraps real search handle in descriptor
- FindNextFileA: Forwards to real API
- FindClose: Properly cleans up search handles

Linux mocks:
- opendir: Wraps real DIR* handle in descriptor
- readdir: Forwards to real API
- closedir: Properly cleans up directory handles

Common changes:
- Added DESC_DIRECTORY descriptor type to track directory handles
- Added real_d field to Descriptor for directory handles (HANDLE on Windows, DIR* on Linux)
- Updated close_desc to handle directory cleanup on both platforms
- Added sys_* macros for both BUILD_TEST and non-BUILD_TEST modes
- Added <dirent.h> include for Linux directory operations
2025-11-13 00:44:31 +00:00
cozis 83c2ccb2ca Implement DirectoryScanner object 2025-11-13 01:35:15 +01:00
cozis 88189c6693 Draft of the chunk server endpoint that returns the list of all chunks 2025-11-13 01:09:01 +01:00
cozis e4c5390ca7 Implement CHUNK_LIST endpoints on the metadata server 2025-11-13 00:43:18 +01:00
cozis 7012f582d2 Add chunk management notes to DESIGN.txt 2025-11-12 12:13:52 +01:00
cozis d598ccedb2 Use a default timeout of -1 when metadata_server_step and chunk_server_step don't set an explicit one 2025-11-11 11:38:00 +01:00
cozis 641c1999ad Add notes on the chunk management strategy to DESIGN.txt 2025-11-11 10:48:23 +01:00