Skip to content

Api/refinement#37

Merged
VishalVerma249 merged 28 commits into
mainfrom
api/refinement
Apr 21, 2026
Merged

Api/refinement#37
VishalVerma249 merged 28 commits into
mainfrom
api/refinement

Conversation

@souls-syntax

Copy link
Copy Markdown
Member

Had Anti-Gravity write C wrapper,
Caused whole lot of linker error.
Errors have been resolved.
and things seems to be working fine.
Oh and also had it write main.cpp

All the AI written files have been marked.

Aakarsh Kashyap and others added 28 commits April 2, 2026 02:38
Written SUB, SQUARE, MEAN
…ve that in some time

Auto grad almost complete
FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AUTOGRAD WORKS 4NN XOR WORKS AND LIFE IS BEST
* Added time field in make.sh

* chore/ Running summarizer

* Completed MSE, passed smoke tests

Written SUB, SQUARE, MEAN

* chore/ Running summarizer

* made assign grad memory function

* chore/ Running summarizer

* chore/ Running summarizer

* chore/ Running summarizer

* Somewhat work not tested

* Implemented brackprop_b.cpp and added switch statements for op handling

* Corrected the enum missnaming mistake

* BROKEN : THE FUCKING NN IS NOT LEARNING WRRRRRYYYYYYYYY FUCK

* BROKEN 2 : THE FUCKING NN IS NOT LEARNING WRRRRRYYYYYYYYY FUCK

* Working operations there is still problem with routing but will resolve that in some time

Auto grad almost complete

* FAAAAAAAAAAAAAAAAAAAAAAAA: I HAVE COMPLETED THE AUTOGRAD

FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AUTOGRAD WORKS 4NN XOR WORKS AND LIFE IS BEST

* GPU fallback is working but i feel something is wrong with hybrid path will need to see

* Broken push don't try it it's super broken likely

* CORRECTED: The backend switch and GPU CPU thrashing was resolved, it was some config and default return error

---------

Co-authored-by: Aakarsh Kashyap <souls-syntax@gmail.com>
Introduces include/soft-cuda/python/ with five headers:
  - soft_cuda_python.h  : master include
  - tensor_pool.h       : sc_pool_* arena wrappers
  - tensor_core.h       : sc_tensor_* lifecycle + SC_DTYPE_* constants
  - tensor_ops.h        : sc_tensor_mul/add/relu/... + sc_tensor_evaluate*
  - tensor_graph.h      : sc_graph_t opaque handle, Layer 1 + Layer 2 API
  - tensor_io.h         : sc_save_model / sc_load_model

Adds src/python/sc_bridge.cpp — single C++ TU that implements all sc_*
symbols with extern C linkage, wrapping std::vector via placement-new
in sc_graph_t so Python ctypes/cffi never sees any C++ types.

Updates CMakeLists.txt:
  - Excludes src/python/ from the core GLOB (prevents duplicate symbols)
  - Adds soft_cuda_python SHARED target linked against soft_lib
main.cpp:
  - Complete rewrite using only sc_* bridge functions
  - 9 numbered sections: pools, data, weights, lazy ops,
    build_graph, training loop, inference, save/load, cleanup
  - Pure C (no iostream, no std::vector visible)
  - Demonstrates both Layer 2 convenience API (sc_build_graph,
    sc_graph_step) and data readback (sc_tensor_get_data)

docs/PYTHON_BRIDGE.md:
  - Architecture diagram (Python → sc_bridge → soft_lib)
  - Build instructions (cmake targets)
  - Full API reference for all 5 headers with function signatures
  - Complete Python ctypes example (XOR training from Python)
  - Memory model explanation (arena/bump allocation)
  - Design decision rationale (why placement-new, why SC_DTYPE, etc.)
…g as there is some graurd resoltion i.e. not happening i think i can do it like this
@VishalVerma249 VishalVerma249 merged commit e5259c7 into main Apr 21, 2026
1 check passed
@souls-syntax souls-syntax deleted the api/refinement branch April 21, 2026 07:08
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.

2 participants